View Full Version : Dynamic Class Names?
xohol
February 13th, 2008, 04:59 PM
Hello, i have a bunch of movie clips in my library, with the linkage turned on.
i would like to add them to my stage, but using a variable to access them.
the clips/linkage are names like 'mc1' 'mc2' 'mc3' etc
so how would i do something like this?
var clipVar:String = "mc1"
var newMC:[clipVar] = new [clipVar]()
thanks for any help!
Escape-Artist
February 13th, 2008, 05:01 PM
Try searching a little bit before please... This was asked and answered just yestrday:
http://www.kirupa.com/forum/showthread.php?t=288872
xohol
February 13th, 2008, 05:04 PM
i did seach...
thanks for the link!
craig.clayton
February 17th, 2008, 07:00 PM
Hello, i have a bunch of movie clips in my library, with the linkage turned on.
i would like to add them to my stage, but using a variable to access them.
the clips/linkage are names like 'mc1' 'mc2' 'mc3' etc
so how would i do something like this?
var clipVar:String = "mc1"
var newMC:[clipVar] = new [clipVar]()thanks for any help!
if the linkage name is mc1 then you can add then like this:
var whateverName:mc1 = new mc1();
whateverName.x = 100;
whateverName.y = 100;
addChild(whateverName);
Hope that helps
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.