2 Replies Latest reply on Sep 16, 2010 8:42 PM by FlashTapper

    Animating a button with actionScript

    FlashTapper Level 1

      I'm fairly stumped on this one - but probably quite simple to fix.


      I need to animate the scale of a button with actionScript 2.0. I've inherited a project that was done with actionScript 2.0 and have decided to stay with this generation rather than rewrite the whole project. Anyway - I've created a sound object, it plays audio from the library and 3 seconds after it starts playing, I want to animate the "next" button and make it pulse to attract the users attention.


      Doing this by putting the button in a movie clip is not working as I am losing it's button states and besides it's probably far more tighter to program it.


      When the user rolls over the button it stops pulsing but still retains it's up, over and down states.


      Any easy answer?

        • 1. Re: Animating a button with actionScript
          Ned Murphy Adobe Community Professional & MVP

          You can trigger enterframe processing to have the button continuously scale up and down though there's no telling where your line is for an "easy answer" to be able to judge if it qualifies.  If you are taking a step back in terms of what you know, then it may not be too hard for you to figure out.  Just have the code that triggers the sound to also trigger a setTimeout call that will initiate the enterframe processing 3 seconds later.

          1 person found this helpful
          • 2. Re: Animating a button with actionScript
            FlashTapper Level 1

            Thanks for your help Ned.


            I ended up making an advanced button with movie clips and using programming for all the states.

            Movies are so much easier to control than buttons.


            But you have raised something I had overlooked...setTimeout( )


            I was using setInterval( ) and then doing clearInterval( ) within the function so it would only loop once, which of course was problematic if the user beat the 'clearInterval' code by clicking on the button too early.


            Actually used setInterval( ) to delay all sound on the project - now going to re-program all that.