I have a movieClip with one frame on the timeline containing one child whose instance name is “myContent”
I am using this function to swap “myContent” with any number of possible class instances.
function setContentAsClass(c:Class)
{
removeChild(myContent);
myContent=new c;
addChild(myContent);
} //end
It works fine if the initial “myContent” instance on my timeline is movie clip which IS NOT exported as a class for action script. If, however, “myContent” is initially of a class that IS exported for action script, I get errors such as this…
TypeError: Error #1034: Type Coercion failed: cannot convert possibleContent1@1e2940e9 to myInitialContentClass.
Any idea why this is so?