4 Replies Latest reply on Mar 31, 2010 8:47 AM by yehuda1233456

    flex effect status

    yehuda1233456

      is theire a property for flex effect object that represent his current status?

       

      something like :

       

      if(myEffectObj.status == 'end') {

           myEfectObj.play(new Array(myItem));

      }

       

      sorry again for my english i use to speake hebrew...

       

      thank you

        • 1. Re: flex effect status
          Matt Le Fevre Level 4

          yehuda1233456 wrote:

           

          is theire a property for flex effect object that represent his current status?

           

          something like :

           

          if(myEffectObj.status == 'end') {

               myEfectObj.play(new Array(myItem));

          }

           

          sorry again for my english i use to speake hebrew...

           

          thank you

           

          something like this?

           

          myEffectObj.addEventListener(EffectEvent.EFFECT_END, doThis)
          
          public function doThis(evt:Event):void
          {
                      myEfectObj.play(new Array(myItem));
          }
          
          • 2. Re: flex effect status
            yehuda1233456 Level 1

            thank you grizzz

            will this event  take place if the effect never started too?

            • 3. Re: flex effect status
              Matt Le Fevre Level 4

              if you add it as your application starts up, it'll occur whenever the effect ends.

               

              If the effect never ends, ie: it never occurs

               

              it'll never call the 'doThis' function.

               

               

               


              there are also cases where you want to remove the listener, for which you can use

               

              myEffectObj.removeEventListener(EffectEvent.EFFECT_END, doThis);

               

              which'll stop the 'doThis' function from being called whenever an effect may end.

              • 4. Re: flex effect status
                yehuda1233456 Level 1

                OK i found a way to work around with this

                 

                if (arrowMove) {

                     arrowMove = false;

                     shakeRight.addEventListener(EffectEvent.EFFECT_END, function():void {

                          arrowMove = true

                     })

                     shakeRight.play(new Array(left));

                }   

                 

                thank you!