Petwoip
November 4th, 2009, 01:57 AM
Yeah, this is probably the most common problem on these boards. However, I think my specific problem is sufficiently different.
I have a movie clip on the stage with the instance name "ball".
In my code, I addChild(ball) to a Ball object called "mainBall".
After doing that, I want to remove "ball" from the stage.
Finally, I add addChild(mainBall) to stage.
The code takes place in my Document class:
var mainBall:MovieClip = new Ball()
mainBall.addChild(ball)
stage.removeChild(ball)
addChild(mainBall)
From the code, I get the error: "The supplied DisplayObject must be a child of the caller".
It might be hard to explain why exactly I'm going through this process. If possible, just ignore that and try to explain why what I've done doesn't work.
I have a movie clip on the stage with the instance name "ball".
In my code, I addChild(ball) to a Ball object called "mainBall".
After doing that, I want to remove "ball" from the stage.
Finally, I add addChild(mainBall) to stage.
The code takes place in my Document class:
var mainBall:MovieClip = new Ball()
mainBall.addChild(ball)
stage.removeChild(ball)
addChild(mainBall)
From the code, I get the error: "The supplied DisplayObject must be a child of the caller".
It might be hard to explain why exactly I'm going through this process. If possible, just ignore that and try to explain why what I've done doesn't work.