[_] concatenation in a for loop (AS2)
Jon Bennett
jmbennett at gmail.com
Tue Aug 21 11:10:47 BST 2007
> heres some code:
>
> for(var i:Number=0;i<=10;++i){
>
> _root.lhand.screenText.createEmptyMovieClip("pinbox"+i,_root.lhand.screenText.getNextHighestDepth())
>
> _root.lhand.screenText.$out.createEmptyMovieClip("pin"+i,_root.lhand.screenText.getNextHighestDepth())
> _root.lhand.screenText.pinbox1._x=10;//clearly this will
> only set the _x for the first mc spawned
> _root.lhand.screenText.pinbox1._y=(30+(10*i));// as above
>
> _root.lhand.screenText.pinbox1.pin1.loadMovie('../images/scaled_screens/pin.png')
> _root.lhand.screenText.createTextField("text"+i,
> _root.lhand.screenText.getNextHighestDepth(), 30, (30+(10*i)), 100,
> 22).text=_root.scape._mPlaces[i]
> }
>
> is there some way to force the compiler to generate a new variable name
> on each iteration ?
try something like http://bin.cakephp.org/view/425646717
hth
jon
--
jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett