class com.intomotion.Panel extends MovieClip
{
//properties
private var newBlurFilter : BlurFilter;
private var myBlurIn : Blur;
private var myListener : Object;
//constructor
public function Panel ()
{
APCore.initialize ();
myListener = new Object();
APCore.addListener(myListener);
newBlurFilter = new BlurFilter ();
newBlurFilter.blurY = 20;
newBlurFilter.blurX = 20;
myBlurIn = new Blur (this, 1, newBlurFilter);
myBlurIn.animationStyle (500, Linear.easeOut);
}
//methods
public function grow (paramsObj : Object) : Void
{
var goalY : Number = paramsObj.y;
var goalW : Number = paramsObj.w;
var goalH : Number = paramsObj.h;
new Move (this).run (goalX, goalY, 250, Linear.easeOut,"onMotionFinished");
new Scale (this).run (goalW, goalH, 250, Linear.easeOut);
//blur
myBlurIn.animate (100, 0);
}
check out the readme.htm under Event Handling. There are two ways to do event handling in AP. I'd recommend you use EventDispatcher. use addEventListener to register to the onEnd event of Move.
Best,
Alex
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
I am a huge fan of the Animation Package!
I'm having trouble implementing it with callbacks in a Class.
import de.alex_uhlmann.animationpackage. *;
import de.alex_uhlmann.animationpackage.animation. *;
import de.alex_uhlmann.animationpackage.drawing. *;
import de.alex_uhlmann.animationpackage.utility. *;
import com.robertpenner.easing. *;
import flash.filters.BlurFilter;
class com.intomotion.Panel extends MovieClip
{
//properties
private var newBlurFilter : BlurFilter;
private var myBlurIn : Blur;
private var myListener : Object;
//constructor
public function Panel ()
{
APCore.initialize ();
myListener = new Object();
APCore.addListener(myListener);
newBlurFilter = new BlurFilter ();
newBlurFilter.blurY = 20;
newBlurFilter.blurX = 20;
myBlurIn = new Blur (this, 1, newBlurFilter);
myBlurIn.animationStyle (500, Linear.easeOut);
}
//methods
public function grow (paramsObj : Object) : Void
{
var goalY : Number = paramsObj.y;
var goalW : Number = paramsObj.w;
var goalH : Number = paramsObj.h;
new Move (this).run (goalX, goalY, 250, Linear.easeOut,"onMotionFinished");
new Scale (this).run (goalW, goalH, 250, Linear.easeOut);
//blur
myBlurIn.animate (100, 0);
}
private function onMotionDone () : Void
{
trace ("onMotionDone");
}
}
I want onMotionDone to fire each time an new Move instance is done moving.
Could you kindly point out what I'm doing wrong?
FP 8.
Many thanks.
Hi there,
check out the readme.htm under Event Handling. There are two ways to do event handling in AP. I'd recommend you use EventDispatcher. use addEventListener to register to the onEnd event of Move.
Best,
Alex