PDA

View Full Version : create instance of random class


Billy T
10-23-2007, 06:03 AM
hey all

in as 2 you could set up a bunch of movies with linkage ids of id1,id2, id3 etc and then get a random number and use that in the attachmovie line

eg

_root.attachMovie('id'+randomNum,'mc',1);


How do you do this in AS3?

Thanks in advance

Flash Gordon
10-23-2007, 07:38 AM
var b:Class = getDefinitionByName("box"+1) as Class;
addChild( new b() )

Billy T
10-23-2007, 11:39 AM
nice one thanks for that ;)