I have an mc on the stage named mcOnStage inside of this mc is another mc named mcInside. I have an mc in the library with a linkage class name of TestMc. I want to instantiate TestMc and then use setChildIndex to put mcInside on top of testMc. This doesn’t work, I get Error #2025: The supplied DisplayObject must be a child of the caller.
public class Test extends MovieClip {
private var testmc:TestMc;
public function Test() {
testmc = new TestMc;
addChild(testmc);
this.setChildIndex(mcOnStage.mcInside, this.numChildren - 1);
}
}
is there a was to achieve this? what am i doing wrong.
help is much appreciated.
Thank you