This content has been marked as final. Show 8 replies
Where is this "stn_Array.lenght" coming from?
use array notation to convert as2 strings into objects:
kglad: Thanks for the super-quick and tremendously helpful response! Much appreciated!
A couple of quick follow-up questions:
kglad wrote that "createEmptyMovieClip() returns a reference to the created movieclip".
How would I use/access this reference?
Also, in the updated code below, I have two issues:
1. rolling over a movie clip yields "this is button undefined" rather than "this is button a" for example; and
2. clicking on a movie clip outputs the result of the trace command for all four clips (in reverse order) rather than just the one clicked.
Any insights into what I need to do differently? Thanks again!
1) because "i" is iterated through to the last value of the loop, using i to access the array within the onRollOver, will no longer be valid after the loop has executed. to remedy, 'store' the string var as a property of the newly created clip - or use this._name within the trace (it will return the name of the mc however rather than just "a" - eg. a_mc)
2) the onMouseDown handler is a method of the Mouse class, use an onPress handler instead (in the above, each mouse click will trigger all of the handlers)
kgland and clbeech: Thank you *very* much for your help; I've learned a lot from it!
you're welcome (but kg did the real work here ;)