1 Reply Latest reply on Jun 22, 2006 11:36 AM by kglad

    Animation irregularity

    pete_k
      I am very new to flash so please bear with me..

      I am trying to create a simple interaction: when the user mouses over one coloured box that the second coloured box will move to the side (instead of partially covering the first box)

      I have used this code:

      on(rollOver){
      red._x=10
      }
      on(rollOut){
      red._x=-10
      }

      This provides what I am looking for, except when you mouse over for the first time, the 2nd box jumps to the side of the screen, any subsequent mouseovers and mouse offs results in the desired effect (but with the box having assumed a new origin half off the screen)

      Any idea why this is happening? or a better suggestion on how to do this?
        • 1. Re: Animation irregularity
          kglad Adobe Community Professional & MVP
          if that code is attached to a movieclip then red must be a child movieclip and it's going to move to an _x position relative to its parent timeline. ie, if red is currently at 400 on its parent timeline, it will move quite a bit on the first rollover.

          if you want red to move BY 10 pixels with each rollover/rollout use: