|
-
apply to global buttonmode
I have a site thats finally functioning the way i want it, but i didn't add any rollover effects anywhere in the site. Looking back at it, that was probably a bad idea...
i was curious, how would i go about writing a global buttonmode rollover that just dropped the opacity to .66 on mouse over. That way anything i set buttonmode = true on would at least give some interface feedback.
-
Senior Member
I had a similar problem recently... basically what you need to do is simple.
Write a VERY simple class that will extend either Sprite or MovieClip (depending on your functionality) and call it, i dunno, CustomButton.as.
The only thing in the constructor method should be buttonmode = true.
Then, write two public methods inside this class - "over", which sets the opacity to .66, and "out" which sets it back to 1.
Leave all of your listeners and other functionality where it currently lives in your project, but add the call to [whateverbutton].over in the rollover listener, and [whateverbutton].out on rollout.
Change the linkage parameters of every instance of a button in your library to have the baseclass of "CustomButton" instead of flash.display.MovieClip, and you should be set.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|