Have A Banana,
[quoted text, click to view] > for(i = 0; i <= 33; i++){
> _root.pictureBox.*i*._visible = false;
> _root.pictureArray = _root.pictureBox.*i*;
> }
In the above for() loop, i begins as 0 (zero) and continues until 33.
The assumption, then, is that you have 34 movie clips (zero to 33). Each
clip must have an instance name, and it appears as if your instances are all
contained within another movie clip whose instance name is pictureBox.
For sake of discussion, let's say your landmark clips have instance
names like this: landmark0, landmark1, landmark2, and so on. You're hoping
to set the _visible property of each clip to false. In other words ...
_root.pictureBox.landmark0._visible = false;
_root.pictureBox.landmark1._visible = false;
_root.pictureBox.landmark2._visible = false;
/// etc. through 33
You can accomplish this with the array access operator, which allows you
to use strings in your dot notation.
_root.pictureBox.landmark0
.... is the same as ...
_root["pictureBox"].landmark0
.... for esample, which is also the same as ...
_root.pictureBox["landmark0"]
.... again, notice where the dots are replaced by brackets, and that the
brackets contain strings. As it happens, you can also use variables in your
array access operators, as long as, in the end, the result is a string. In
ActionScript, you can concatenate something like "landmark" (a string) and i
(a number) and get a string.
So your for() loop might look like this:
for(i = 0; i <= 33; i++) {
_root.pictureBox["landmark" + i]._visible = false;
}
Make sense?
Now, to add these items to an array, you'll have to use an Array class
method. Your best bet is to look up the Array class in the ActionScript
Language Reference. Look up Array.push() and you'll get what you're after.
By using the equals sign the way it is currently in your code, you're merely
resetting the whole array object each time to a number, rather than adding
an item to your array.
David
stiller (at) quip (dot) net
Tackling the ActionScript Language Reference
http://www.quip.net/tutorials/