Movieclip instance != created instance ?
Hi all,
I'm working in FB4, but I think this is an AS3 question ![]()
I'm dynamically creating a MovieClip instance (It's a flash symbol that inherits from a MovieClip):
var cls:Class=_loaderInfo.applicationDomain.getDefinition("com.company.SymbolName") as Class;
var mySymbol:Object;
try {
mySymbol=new cls;
} catch (error:Error) {
...
}
This works fine, and I can add it to the stage: stage.addChild(obj) and I actually see it.
Now when I click on it, I expect the MouseEvent.target to point to the mySymbol instance. But it doesn't!
MouseEvent.target points to another instance of a MovieClip... I can see that because this expression fails
stage.addEventListener(MouseEvent.MOUSE_DOWN, startDrag);
function startDrag(event:MouseEvent):void {
trace(mySymbol === event.target); // false!
}
when clicking on the mySymbol visual instance, and in FB3 debug mode, I can see different addresses for mySymbo and event.target...
Does anyone have a clue? I need to backtrack the creator of the mySymbol on clicking, I only have the clicked instance,
and from there on I need to find the object that created the mySymbol instance.
Thanks,
Ronaldo