-
Member Mofo
array of Movie Clips 2
I already asked this question, but I thought I'd simplify what I'm asking. If I've got an array that contains mc names like this:
PHP Code:
var homeArray = new Array("home1_mc",
"home2_mc",
"home3_mc",
"home4_mc",
"home5_mc",
"home6_mc",
"home7_mc",
"home8_mc");
How do I do the equivalent of this:
PHP Code:
var i:MovieClip = homeArray[0];
var image1:MovieClip = addChild(new i);
-
You have all sorts of type misunderstandings above. There's really NO reason to put Strings in your array. I think what you really want in your array is Classes. So, if you have these clips in your library, export them for actionscript with appropriate class names (which differ from instance names). Then you can do this:
Code:
var homeArray = [Home1, Home2, Home3, Home4, Home5, Home6, Home7, Home8];
var homeClass:Class = homeArray[0];
var image1:MovieClip = addChild(new homeClass());
-
Member Mofo
Thank you, I finally got it working!
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
|