1 Reply Latest reply on Sep 9, 2007 1:26 PM by Newsgroup_User

    I need help with a button animation!

    AndyLamb Level 1
      Hi,

      I hope someone can help with a simple-looking problem which nonetheless has me stumped!
      I have a feeling that I've missed something obvious.

      I've created a movie clip to act as a button (I've called it "abs_button") and placed it on the stage.
      My main movie has one frame.
      Within the "abs_button" movie clip there are 5 layers. Labels, actions, default button state, rollover state and rollout state.
      Technically, default button state, rollover state and rollout state could be on the same layer as they don't overlap, but I've given each animation its own layer for clarity.

      FRAME 01.
      Default button state is one frame with a graphic of the button. Just a label at the start ("abs_up") and a "stop();" action at the end.
      FRAME 02 to 31.
      Rollover state is a 30 frame animation. Label at start ("abs_over"), "stop()"; action at the end.
      FRAME 32 to 62.
      Rollout state is a 30 frame animation. Label at start ("abs_out"), "stop()"; action at the end.

      All animations were achieved with tweens.

      My initial "abs_button" code:
      "
      on (release) {
      getURL("targetPage.htm", "_self");
      }
      on (rollOver) {
      gotoAndPlay("abs_button", "abs_over");
      }
      on (rollOut) {
      gotoAndPlay("abs_button", "abs_out");
      }
      "

      As it stands, the animation jumps to frame 1 of "abs_out" on rollout.
      I need the "abs_over" animation to always play through to the end, as the "abs_out" is "abs_over" in reverse (i.e. image grows large on rollover and shrinks again on rollout.

      I've tried for 2 days to solve this, but I clearly need help. My experiments with variables simply didn't work.
      I would be grateful if someone could tell me where I'm going wrong!

      Thanks,
      Andy