1 Reply Latest reply on Jun 21, 2006 2:35 PM by Newsgroup_User

    Problem with Sequence

    nrmncook
      I'm having some issues with the Sequence class. I created 2 Glow instances (one is the inverse of the other), then I created a Sequence instance and added them via the addChild() method. Now, the sequence is being played whenever the user moves the mouse cursor over the display object, and stops when the mouse cursor moves out. The problem is, invoking the end() method just stops the current playing child effect, not the whole sequence, so when the MOUSE_OUT event fires and the first effect is playing, the display object ends up with a big fat glow on it (which is the state in the middle of the sequence).
      Are we talking about a bug or I am the one in error?
        • 1. Re: Problem with Sequence
          Level 7
          For rollOver effects on a target, try something like this: (replace the Zoom
          effect with the your Glow)

          <?xml version="1.0" encoding="utf-8"?>
          <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="vertical">

          <mx:Script>
          <![CDATA[
          import flash.events.MouseEvent;
          import mx.effects.Effect;

          public function doZoom(event:MouseEvent, effect:Effect):void
          {
          if (effect.isPlaying)
          {
          effect.reverse();
          }
          else
          {
          effect.play([event.target], event.type == MouseEvent.ROLL_OUT ? true :
          false);
          }
          }

          ]]>
          </mx:Script>

          <mx:Zoom id="zoomEffect" duration="200" zoomHeightFrom="1"
          zoomHeightTo="1.5" zoomWidthFrom="1" zoomWidthTo="1.5"/>

          <mx:Button label="The Target" rollOver="doZoom(event,zoomEffect)"
          rollOut="doZoom(event,zoomEffect)"/>

          </mx:Application>

          --
          Jason Szeto
          Adobe Flex SDK Developer


          "nrmncook" <webforumsuser@macromedia.com> wrote in message
          news:e70g86$402$1@forums.macromedia.com...
          > I'm having some issues with the Sequence class. I created 2 Glow instances
          > (one
          > is the inverse of the other), then I created a Sequence instance and added
          > them
          > via the addChild() method. Now, the sequence is being played whenever the
          > user
          > moves the mouse cursor over the display object, and stops when the mouse
          > cursor
          > moves out. The problem is, invoking the end() method just stops the
          > current
          > playing child effect, not the whole sequence, so when the MOUSE_OUT event
          > fires
          > and the first effect is playing, the display object ends up with a big fat
          > glow
          > on it (which is the state in the middle of the sequence).
          > Are we talking about a bug or I am the one in error?
          >