2 Replies Latest reply on Nov 18, 2011 7:29 AM by Ned Murphy

    Detect play / stop

    snopims_

      Hi

      I have :

      File SWF A

           |---- File SWF B

                |------- Movie Clip MC

      I need detected in B when A use B.play() or B.stop() because i want this sequence :

      A : B.play() -> B : MC.play()

      A : B.stop() -> B : MC.stop()

       

      I want :

       

      Stage.addEventListener(xxx.PLAY, propagePlay);

      Stage.addEventListener(xxx.STOP, propageStop);

      function propagePlay(evt:XXXXX):void {  enfant.play();}

      function propageStop(evt:XXXXX):void {  enfant.stop();}

       

      I don't know event ?

       

      or overrided

       

      override function stop():void

      {

      super.stop()

      enfant.stop();

      }

      => I had function that is not marked for override

       

      But i don't konw, is it possible and/or exact syntax.

       

      does someone have some idea?

       

      thanks in advance

        • 1. Re: Detect play / stop
          Ned Murphy Adobe Community Professional & MVP

          You can dispatch an event of your own, though you have to manually generate it, meaning there is no event I know of that signals a stop() or play() command has been executed.  So if you have a stop(). then it should be followed by a line where you use something like...

           

          dispatchEvent(new Event("stopTriggered"));

           

          realizing that I named that event whatever I wanted, it is not a built-in event

          1 person found this helpful
          • 2. Re: Detect play / stop
            Ned Murphy Adobe Community Professional & MVP

            One other thing, if your code is all going to be in the same location, then you don't really need to dispatch and lsiten for events.  You can just call a function instead... In fact you could create your own function such as stopIt(), where it contains both the timeline command to stop() and whatever other commands you intend to execute as a result of stopping.

            1 person found this helpful