How can I dynamically create object names (or functions) in a repeat loop, now that AS3 does not support the [] operator?
For example, how would I do the following in AS3?
[COLOR=blue]//create first column of text input objects [/COLOR]
[COLOR=blue]for (i=1; i<=7; i++) [/COLOR]
[COLOR=blue]{ [/COLOR]
[COLOR=blue]var yvalue= i*30; [/COLOR]
[COLOR=blue]this.createTextField([“mytext”+i], this.getNextHighestDepth(), 10, yvalue, 100, 22); [/COLOR]
[COLOR=blue]this[“mytext”+i].border = true; [/COLOR]
[COLOR=blue]this[“mytext”+i].type = “input”; [/COLOR]
[COLOR=blue]this[“mytext”+i].tabIndex=i; [/COLOR]
[COLOR=blue]}[/COLOR]
Or for creating onRelease or onRollover events for movie clips??
[COLOR=blue]for (i=1; i<=myVar; i++) [/COLOR]
[COLOR=blue]{
this[“myButton”+i].onRollOver = function() [/COLOR]
[COLOR=blue]{
trace(“do stuff here”);[/COLOR]
[COLOR=blue]}[/COLOR]
[COLOR=blue]}[/COLOR]