Instance name is null?
i generated list of movieclip contain different text.
for(var i:int=0;i<locationarray.length;i++) {
locationmc=new locationname();
addchild(locationmc)
locationmc.name="loc1"
locationmc.locationtxt.text=locationarray[i];
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 check on instance name show null, code checking follows
public function testobject(e:event){
trace(e.target.name)
trace(e.currenttarget.name)
}
it possible e.target not think is. try tracing e.target see trying name from. when trace e.currenttarget going object has listener assigned, in case stage, not implement name property.
More discussions in ActionScript 3
adobe
Comments
Post a Comment