SteveD
April 28th, 2003, 10:08 AM
Hi,
I have been helping out a few members here with arrays in an effort to finally get my head around them. I think that arrays are probably one of the more powerful tools available in flash, but...... I got myself stuck and need some help. I feel sure it just a syntax issue. here goes:
mc with instance name but0
inside mc is a text box var name label , code is
label = _name;
mc on main timeline code in frame 1 is:
subjects = new Array("page1","page2","page4","page4","page5")
butHeight = but0._height+5;
butNumber = subjects.length
if (i<butNumber) {
but0.duplicateMovieClip("subjects"+i,i);
with(this["subjects"+i]) {
_y= butHeight*i;
}
i++
}
but0._visible = 0;
What this code does is produce 5 buttons appearing one after the other, like a cascade effect, so far so good, I then want to insert the array elements into text box label, but all I get is subject, subject1, subject2 and so on.
So, what do I need to do so that my buttons are called page1, page2 and so on.
Cheers
SteveD
I have been helping out a few members here with arrays in an effort to finally get my head around them. I think that arrays are probably one of the more powerful tools available in flash, but...... I got myself stuck and need some help. I feel sure it just a syntax issue. here goes:
mc with instance name but0
inside mc is a text box var name label , code is
label = _name;
mc on main timeline code in frame 1 is:
subjects = new Array("page1","page2","page4","page4","page5")
butHeight = but0._height+5;
butNumber = subjects.length
if (i<butNumber) {
but0.duplicateMovieClip("subjects"+i,i);
with(this["subjects"+i]) {
_y= butHeight*i;
}
i++
}
but0._visible = 0;
What this code does is produce 5 buttons appearing one after the other, like a cascade effect, so far so good, I then want to insert the array elements into text box label, but all I get is subject, subject1, subject2 and so on.
So, what do I need to do so that my buttons are called page1, page2 and so on.
Cheers
SteveD