Menu

onEnd with Parallel

Help
2006-02-21
2013-04-01
  • Tianzhen Lin

    Tianzhen Lin - 2006-02-21

    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!

     
    • Alex Uhlmann

      Alex Uhlmann - 2006-02-23

      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

       

Log in to post a comment.