function loadTarget(e:MouseEvent):void {
trace(e.target.name);//pr1 for example
var loadObject:Object = e.target.name + “c”
trace(loadObject.name);// pr1c for example
addChild(loadObject);
}
var pr1c:pr_01_01_content = new pr_01_01_content;
pr1c.name = “pr1c”;
var pr1:pr_01_01 = new pr_01_01;
pr1.name = “pr1”;
for (var i:int = 0; i < prMenuNum; i++) {
pr_dropdown1.pr_01_mc.addChild(aPr_01*);
aPr_01*.addEventListener(MouseEvent.CLICK, loadTarget);
}
What I need to do here is in the loadTarget receive the MouseEvent and add “c” to the end of the object name pr1. What I think is happening is that it turns it into a string and is no longer of the “object” class. Here is the Error Description:
“1118:Implicit coercion of a value with static type Object to a possibly unrelated type flash.display:Object.” from the addChild(loadObject) line.