PDA

View Full Version : Button Instance


Christopher
08-29-2001, 04:18 PM
If you add a button to your scene in the first keyframe.
And later you move the position of that button by inserting a new keyframe (say keyframe 5) and drag the button to a new location for that keyframe.

My question is: If I want to trap the on rollover event for that button no matter where I move it on the screen how do I do that?

If I rightmouse on the button and click on actions - goto the mouse events and add say trace("over me"); it will only work for that location, even though its the same button.

I hope this is a silly question, and appreciate any help.

Thanks,
--Chris

Jesse
08-30-2001, 02:07 AM
But it's not the same button. It might look exactly the same and smell the same, but it's not the same. Instances are unique. If you want the code to work the same wherever, without having to add it again and again your best move would be to whack the button inside a movieclip with the actions on it (paths properly adjusted to account for the parent movie clip). Thhis way you can move the movie clip around, but the code on the button inside it will always be the same.

Christopher
08-31-2001, 01:50 PM
Adding the button to a movie clip did the trick.
Thanks Jesse !!