Instance name is null?
I generated a list of movieclip that contain different text.
for(var i:int=0;i<locationarray.length;i++) {
locationmc=new locationname();
addChild(locationmc)
locationmc.name="loc1"
locationmc.locationtxt.text=locationarray;
locationmc.x = Math.floor(Math.random() * 500);
locationmc.y = Math.floor(Math.random() * 300);
locationmc.y=100;
locationmc.x=200;
trace(locationmc.name)
locationobject.push(locationmc)
locationmc.addEventListener(MouseEvent.MOUSE_DOWN,mousedown)
locationmc.addEventListener(MouseEvent.MOUSE_UP,mouseup)
stage.addEventListener(MouseEvent.CLICK,testobject);
}
But when I do a check on the instance name it would show up null, code for the checking is as follows
public function testobject(e:Event){
trace(e.target.name)
trace(e.currentTarget.name)
}
