1 Reply Latest reply on Jan 12, 2009 8:08 AM by Newsgroup_User

    Constraints and effects

    Marlene Level 1
      Still new to Flex. I want to center a large image on the stage that fades away to expose a logo. The logo then moves to the top left of the stage. I am using an absolute layout and horizontal and vertical constraints on both images. I am using a Sequence of a fade and move. This works fine. The image fades away and the logo moves to the top left. But after the logo moves to the top left it then snaps back to the center constraints. Is there a better way to do this or a way to override the constraints after an effect is applied.
        • 1. Re: Constraints and effects
          Level 7

          "Marlene" <webforumsuser@macromedia.com> wrote in message
          news:gkf2u2$p33$1@forums.macromedia.com...
          > Still new to Flex. I want to center a large image on the stage that fades
          > away
          > to expose a logo. The logo then moves to the top left of the stage. I am
          > using
          > an absolute layout and horizontal and vertical constraints on both images.
          > I am
          > using a Sequence of a fade and move. This works fine. The image fades away
          > and
          > the logo moves to the top left. But after the logo moves to the top left
          > it
          > then snaps back to the center constraints. Is there a better way to do
          > this or
          > a way to override the constraints after an effect is applied.

          Use an event listener that listens for the effect to end, then do something
          like this inside the function:

          logo.setStyle('horizontalCenter', null);
          logo.setStyle('verticalCenter', null);
          logo.setStyle('top', 0);
          logo.setStyle('left', 0);

          Note I haven't tried this, but it's the best theory I have at this moment
          ;-).