Flash button question

Posted:
in Mac Software edited January 2014
Does anyone know how to make Flash buttons in the style of these on www.newgrounds.com? (The menubar ones) I can make simple buttons that play an animation when rolled over, but how do you make buttons that fade in when rolled over, and then fade out when the pointer is moved off them?

Some specifics: I want to make a Flash button that smoothly starts to glow when rolled over, and then subtly pulses for the duration of the rollover, and then the glow fades out smoothly when the pointer is removed.



Any advice, Flash experts?

Comments

  • Reply 1 of 10
    johanjohan Posts: 6member
    Code:




    on (rollover) {

    but_anim._gotoAndPlay('over');

    }

    on (rollout) {

    but_anim._gotoAndPlay('out');

    }









    ...off the top of my head been a while (thank god) since I did flash dev.



    your but_anim clip contains the "glow in/glow out" animation, so it's really not all that different from what you said you've done before..



    I bet you're thinking that you could code that up right?

    remember, it's just flash.. the closet you can get to that is to tint it (which you can with AS)
  • Reply 2 of 10
    gargoylegargoyle Posts: 660member
    This is how I would do it. make the movie with a nice fade in then fade out. In the first frame you will need this code (you will have to look it up, I am doing this from memory and its been a while, so some of the functions will prolly not be named exacly as shown)



    Code:




    onclipenterframe {

    if(this.testvar == true){ gotoAndPlay(2); }

    else { gotoAndPlay(1); }

    }









    Then for mouseover and mouse out events, you set the testvar to true and false respectively, and this ensures that once your movie has been started (mouseover) it will complete the fade before the next check of testvar, not halfway through.
  • Reply 3 of 10
    gargoylegargoyle Posts: 660member
    If you get stuck send me a PM. If I have time, I will install flash and make a sample button and some notes for ya.
  • Reply 4 of 10
    gargoylegargoyle Posts: 660member
    OK, Here we go...



    Step one

    Create a pulse movie symbol, this will be the actual gfx of your button. In the first frame put a stop(); action.



    Step two

    Create a transparent button with a hit area the same size as your movie graphics.



    Step three

    Make 3 layers on the main timeline, from the bottom up, Movies, Buttons, Actions.



    In the actions layer enter the following code for the first frame. (you will only have 1 frame anyway.)

    Code:




    _root.buttonplaying = "none";









    step 4

    Select your movies layer and drop the pulse movie onto the stage. Then click on the movie on the stage and display the actions pannel. Then enter this code...

    Code:




    onClipEvent (enterFrame) {

    if(_root.buttonplaying == "one"){

    play();

    }

    }









    step 5

    Select the buttons layer, and drop a transparent button over the movie clip. Select it and show the actions panel and enter this code...

    Code:




    on (rollOver) {

    _root.buttonplaying = "one";

    }

    on (rollOut) {

    _root.buttonplaying = "none";

    }









    Repeat steps 4 & 5 for as many buttons as you want, changing the "one" to "two" etc...



    pulsebutton.swf

    pulsebutton.fla
  • Reply 5 of 10
    another simple way to do this would be to use the "animated rollover component".



    description : Drop this component on any movieclip to make it animate from frame 1 to _totalFrames when the mouse enters it. The component will animate the clip back again, when the mouse leaves the movieclip. (description from flashcomponents.net)



    link to component
  • Reply 6 of 10
    gargoylegargoyle Posts: 660member
    Prolly would have helped if I looked at the example link on the original post. As I read it, I thought the button needed to pulse while the mouse was over, but complete a pulse if the mouse was moved off half way through.



    Ahh well, too good examples for you to enjoy.
  • Reply 7 of 10
    placeboplacebo Posts: 5,767member
    Thank you guys a lot. I mean, a lot.
  • Reply 8 of 10
    do you still need help with this?

    i would whip up a fla for you, but i'm leaving for a short vacation in a couple of hours ...

    i could get it done by next weekend if you can wait ... otherwise i suggest going to flashkit for all your flash needs.
  • Reply 9 of 10
    placeboplacebo Posts: 5,767member
    Thanks, brian.fury. I couldn't think of any other forums to post my question on, but now I know that there is one.
  • Reply 10 of 10
    you should also check out the forums over at were-here.com. i haven't visited them in a while, but you can always get some great help from the community over there.
Sign In or Register to comment.