1 Reply Latest reply on Dec 18, 2007 10:04 AM by Newsgroup_User

    Best way to do hover buttons

    PKENGLISH
      Hi,

      I have a bunch of buttons on my page and when they are hovered over it tells the specific button to advance its current frame so that the button fades to white. When it rolls off it returns etc. The way I am doing this is through an onEnterFrame for each button that has an if statement to test if it is being hovered over.

      Now this works fine but it is very slow as you can imagine because there are several onEnterFrames running at one time. Can anyone tell me of a a better (less memory intensive) way to achieve what i am trying to do?

      Thanks!
        • 1. Re: Best way to do hover buttons
          Level 7
          PKENGLISH,

          > The way I am doing this is through an onEnterFrame for
          > each button that has an if statement to test if it is being
          > hovered over.

          That's one of many events available to the MovieClip and Button classes.
          If this button is made from a movie clip symbol, then check the MovieClip
          class entry of the ActionScript 2.0 Language Reference. You'll see
          onRollOver, onRollOut, and others that may suit your need. Event handlers
          get assigned in the same way as onEnterFrame events.

          See if that gets you started, and write back if you need to. :)


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."