var myClipDepth:Number = 0
function CreateandRemove(){
if (myClipDepth > 1)
{
removeChildAt (myClipDepth);
}
var square:Sprite = new Sprite();
squarer.x = X_marge;
square.y = Y_marge_submapholder + 10;
addChild (square);
myClipDepth = getChildIndex(square);
trace ( “depth” + myClipDepth);
}
Now if you call the function it doesn’t throw errors all the time and You can start to give it some functionality.
]]>Another wise lesson learned!
]]>I’m pretty sure this is a bug in Flash Player 9, as it never occurs under Flash Player 10. To me the Loader Class should be able to detect if its content is no longer contained within itself, and respond accordingly.
]]>