I try to consume onEnd event by Parallel with the following code (assume I have all the imports)
class abc
{
public function start(mc:MovieClip):Void
{
var p:Parallel = new Parallel();
var a:Alpha = new Alpha( mc, 0, 1000);
var m:Move = new Move( mc, 100, 100, 1000);
p.addChild(a);
p.addChild(m);
public function ani_onEnd():Void
{
trace("end");
}
}
When I run "start", the objects animate, but the trace is never seen. But if I use Delegate with other classes such as Alpha or Move individually, it seems to work. Any ideas?
Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I try to consume onEnd event by Parallel with the following code (assume I have all the imports)
class abc
{
public function start(mc:MovieClip):Void
{
var p:Parallel = new Parallel();
var a:Alpha = new Alpha( mc, 0, 1000);
var m:Move = new Move( mc, 100, 100, 1000);
p.addChild(a);
p.addChild(m);
p.addEventListener("onEnd", Delegate.create( this, this.ani_onEnd));
p.animate(0, 100);
}
public function ani_onEnd():Void
{
trace("end");
}
}
When I run "start", the objects animate, but the trace is never seen. But if I use Delegate with other classes such as Alpha or Move individually, it seems to work. Any ideas?
Thanks!
Hi Lin,
You have to specify the duration of Parallel with i.e. animationStyle() or duration.
p.duration = 1000;
I know it's a bit confusing, I'll think about it for the next version.
Best,
Alex