-
I'm assuming that in principle it is possible to create an array of duplicate movie clips so you can use a loop to acces/change properties of all clips.
But I can't for the life of me figure out how. Does anyone have an example or a code snippet to help out.
Information about arrays in Flash 5 seems to be very thin on the ground.
-
movienames=new Array()
for(i=1;i<=3;++i){
duplicateMovieClip(_root.movieclipname,"mov"+i,i)
movienames.push("mov"+i)
}
this will produce an array as follows:
movienames[0]="mov1"
movienames[1]="mov2"
movienames[2]="mov3"
aswell as creating 3 duplicates of a movie!
you can now change the properties of these movieclips by using:
_root[movienames[0]]._x=300
_root[movienames[1]]._alpha=50
etc..
Hope that helps!
Regards FlashGuru
-
whoa.. interesting... how would this be applied to a swf? like a swf banner rotater within a swf?
-
Question for FlashGuru
FlashGuru,
Thanks for the info, I needed this today..
However, this seems like a workaround for a problem with Flash 5's action scripting language.
Why can't you just directly assign the movie clip reference to an element of an array instead of having to simulate an array and then create the array from those results?
Please Advise,
Generator
-
Re: Question for FlashGuru
Why can't you just directly assign the movie clip reference to an element of an array instead of having to simulate an array and then create the array from those results?
Not sure what you mean, Flash Guru created a new array object in his first line with new Array(); Flash 5 doesn't need to simultate arrays anymore especially with actionscript's new array[indice] notation.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|