"Optional easer function" in MotionTween


(Bimbamm) #1

I cannot completely understand what I am doing wrong. I have a LinearMotion which is working fine except that i cant manage to implement and easer function.

here is the simple code:

var motion:LinearMotion = new LinearMotion();
		
		motion.setMotion(0,0,100,100,20);
		motion.object = object;
		addTween(motion,true);

let’s have a closer look at line 3:

		motion.setMotion(0,0,100,100,20,ease:Function = null);

Previously i have successfully used easer function with Emitters, but this time i keep recieving col 36 Error. what exactly do I have too type? I was so desperate i even tried to guess it. I’ ve typed: “quadIn”, “ease:quadIn”,"{ease:quadIn}. Any help is appreciated.


(Jacob Albano) #2
import net.flashpunk.utils;

// ...

motion.setMotion(0, 0, 100, 100, 20, Ease.quadIn);

(Bimbamm) #3

Thank you very much. Thread can be closed.


(Jacob Albano) #4

No problem. :slight_smile: Glad I could help!


(Zachary Lewis) #5