maxx
07-21-2005, 09:35 PM
OK - first off, this is probably really easy, but I've searched the help files and this forum, and my wife and I just moved and I haven't even found the box with my AS books in it, let alone unpacked it, and I'm stumped...
I have a very simple function that I want to apply to every button in my movie - I'm doing a software sim right now - that sets the text of a dynamic text field to a specific value depending upon the movie clip that triggers the OnRollOver event. Of course, when the user rolls out, I've got a similar function that clears the text. Now, my problem - and question - comes in here...
I really don't want to have to type in an .onRollOver and an .onRollOut handler for each and every button throughout my movie. Is there any way that I can somehow ... group ... the buttons? For the .onRollOut at least - I realize that I may have to write separate scripts for each onRollOver just to pass the proper variable to the text field.
I thought about writing a custom class that handles this, but honestly that's something I've never played with, and I'm not sure that I can pass the variables as needed to correctly populate the text field from within a class extension (for the onRollOver triggers). That plus I really don't know how to script a class extension...
Any ideas? Or am I just stuck doing the repetitive typing? Or am I missing something extremely simple and should go stick my head in the sink to wash out the cobwebs?
I have a very simple function that I want to apply to every button in my movie - I'm doing a software sim right now - that sets the text of a dynamic text field to a specific value depending upon the movie clip that triggers the OnRollOver event. Of course, when the user rolls out, I've got a similar function that clears the text. Now, my problem - and question - comes in here...
I really don't want to have to type in an .onRollOver and an .onRollOut handler for each and every button throughout my movie. Is there any way that I can somehow ... group ... the buttons? For the .onRollOut at least - I realize that I may have to write separate scripts for each onRollOver just to pass the proper variable to the text field.
I thought about writing a custom class that handles this, but honestly that's something I've never played with, and I'm not sure that I can pass the variables as needed to correctly populate the text field from within a class extension (for the onRollOver triggers). That plus I really don't know how to script a class extension...
Any ideas? Or am I just stuck doing the repetitive typing? Or am I missing something extremely simple and should go stick my head in the sink to wash out the cobwebs?