flash cs5 - actionscript for loop iterator to change movie clip name -


I have a bunch of movie clips made in Flash CS5 and all are placed within the forum. I dynamically control each one of them with the code using ActionScript 3. Although I want to control them all at the same time using the loop and just do not work on changing the width of each element.

Here is my code:

Then I have every call made leftbar and their number is 100 times, then the first time is leftBar1 , then LeftBar2 and so on. I can not get it to work. I have tried "Left Bayer" + i and Bariabari , but none of them is working.

  this ["left barber" + i]   

New code:

  // Note: We've changed the starting value from 1 because you mentioned that your first movie clip 'Baba Bai 1 'Var': 'LeftBar0'. (Var i: int = 1; i & lt; = 100; i ++) for {var on: movie clip = this ["left bar" + i]; Current.width = Math .round (channel.rightPeak * 1.1) + 60;}   

Actually you can change the property leftBar0 , leftBar1 , etc. > Y You want to select square brackets. It is like this:

  this.leftBar0   

and any other class It can also be used for properties or methods:

  // Examples of Square Bracket Notation Var Phantom: Sprite = New Sprite (); Phantom ["x"] = 10; Trace (Sprite.x); this ["addChild"] (Sprite);    

Comments