Hi!
I want to add some instance name to bitmap (imported via AS3), and I’ve got this code:
private function loadSlide():void {
//load image
var imgLoader:Loader = new Loader;
imgLoader.load(new URLRequest(src));
imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, createSlide);
}
private function createSlide(e:Event):void {
//add image to stage
var imgLoader:Loader = LoaderInfo(e.target).loader;
var img:Bitmap = Bitmap(imgLoader.content);
img.name = "test";
addChild(img);
but I get an error:
Error #2078: The name property of a Timeline-placed object cannot be modified.
Is there any method to add a name to bitmap object?
Thx!