Button RollOVER and RollOUT aniamtion

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • winterdream28
    New Member
    • Feb 2008
    • 2

    Button RollOVER and RollOUT aniamtion

    i am new to action script 3.0, i am somewhat familiar with 2.0 and can not for the life of me piece together the coding to make a roll/over and then a roll out animation on a button. I see it quite often i know its possible, but i cant seem to figure it out and its holding me back now in a project that im working on.

    i want on the up state for it to just look like asimple button/circl a simple shape. when the user goes over the shape i want there to be an animation int he over state, i want a moveclip to play with that animation and a stop(); to be in that movie clip so when the animation is done it stops, when the use rolls of of the button i dont want it to just snap back to the circle, i want there to be a reverse frame animation on the roll out, i just cant figure out the codeing tho, and how to set it up.....

    i found this post....and ran into simular problems....so i couldnt get it to work
    http://www.thescripts. com/forum/thread725835.ht ml

    ive spent a few hours now trying to find something but all im finding is 3.0.

    any advice?
    -thanks again
    cass
  • adetamor
    New Member
    • Feb 2008
    • 4

    #2
    Here is what I do for similar issues.

    Create a movie clip and in the first frame put the image of the button and a stop() action. Then what you can do, on another layer, is create a duplicate image and put it at 0% opacity and make it a button. Use the following code on that button:

    on (rollOver) {
    gotoAndPlay(2)
    }
    on (rollOut) {
    gotoAndPlay(10)
    }

    What you do from this point is make your rollOver animation start at frame 2. Where your animation ends (lets say frame 9), create an animation that basically duplicates your previous animation, only opposite. Since this animation would start on frame 10, when you rollout, it goes to frame 10 an plays your animation. Just make sure that your button layer goes across all frames for it to work throughout.

    You can also add:

    on (release) {

    //Goto Webpage Behavior
    getURL("about.h tml","_self");
    //End Behavior

    }

    For more functionality.

    Comment

    • winterdream28
      New Member
      • Feb 2008
      • 2

      #3
      great thank you so much, by chance do you know if this also work in action script 3.0? the scripting looks very familiar to 2.0 will this also work in 3.0?

      Comment

      • adetamor
        New Member
        • Feb 2008
        • 4

        #4
        I think it should. I use action script 2 at home but action script 3 at work and I think that I have used the script in both places.

        Comment

        • jrf6cf
          New Member
          • Aug 2010
          • 1

          #5
          how to get button to navigate to parent(main timeline)?¿?

          ive tried your solution but cant get button to navigate back to main timeline. is it possible to accomplish this with a button on the main timeline instead of inserting it into a movie clip. any suggestions would be greatly appreciated.. im at the end of my rope and desperate. thanks in advance

          Comment

          Working...