Okay I have much MCs named 'object1','object2','object3',etc...
But for testing and example I will use just 10.
So what I need is attaching an image to its own MC. Images are in library and they are named 's1','s2','s3',etc..
This is how far I got with scripting:
Can you help me out?PHP Code:import flash.utils.getDefinitionByName;
for (var i:uint=1; i<=10;i++) {
var s:String = "s"+i;
//var cr:String = "CR"+i; something is wrong here xS
var cr:Class = getDefinitionByName(s) as Class;
var ss:Bitmap = new Bitmap( new cr(0,0));
var obj:* = "obeject"+i;
obj.addChild(ss);
}
/*
var s1:String = "s"+1;
var ClassReference01:Class = getDefinitionByName(s1) as Class;
var ss1:Bitmap = new Bitmap( new ClassReference01(0,0));
object1.addChild(ss1);*/
Thanks.




Reply With Quote