Skip to main content
Participating Frequently
June 13, 2020
Answered

Buttons issue- Animate

  • June 13, 2020
  • 1 reply
  • 837 views

I have 4 frames with next/prev frame buttons using action script. Everything works except on the 4th frame if I decide to go back to the 3rd frame, I cannot go forward again unless I go all the way back to the 1st frame. Once I arrive back to the 1st frame, I can do whetever I want again unless I arrive at the 4th frame again, then it's the same deal, need to go back to 1st frame to do what I want again.

 

What's going on?

    This topic has been closed for replies.
    Correct answer kglad

    if firstdown on its own layer with one keyframe at frame 70 and an empty keyframe at frame 73, you can expect the problem you're seeing:  when you advance from frame 72 to 73, firstdown no longer exists and its code is removed.  when you then return to 72, firstdown exists again but its code is not recreated. 

     

    one way to remedy isdon't remove framedown at frame 73.  assign its visible property to false:

     

    firstdown.visible = false;

     

    then when you return to frame 72, it will still be false so add another keyframe at 72 and use:

     

    firstdown.visible = true;

    1 reply

    kglad
    Community Expert
    Community Expert
    July 2, 2020

    are you using the same button for some or all your next frame advances and the same button for some or all your prev frame changes?

     

    if yes, you probably are failing to remove listeners.  

    HenriqueyAuthor
    Participating Frequently
    July 3, 2020

    Thanks for getting back to me. Ok, how can I do that? This is my 'next frame' button which is on frames 70-72 (I also have a close button to transport to frame 69 and I'm not sure if that's relevant):

    And my 'previous frame' button which is on frames 71-73:

    So do I make any adjustments to these or do I do something else?

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    July 3, 2020

    if firstdown on its own layer with one keyframe at frame 70 and an empty keyframe at frame 73, you can expect the problem you're seeing:  when you advance from frame 72 to 73, firstdown no longer exists and its code is removed.  when you then return to 72, firstdown exists again but its code is not recreated. 

     

    one way to remedy isdon't remove framedown at frame 73.  assign its visible property to false:

     

    firstdown.visible = false;

     

    then when you return to frame 72, it will still be false so add another keyframe at 72 and use:

     

    firstdown.visible = true;