AS3 - addchild from stage to movieclip
I just tried to add the movieclip "box" to the "container.holder". Both movieclips are on stage. Nothing happends with this script.
container.holder.addChild(box);
Wh开发者_运维技巧at do I miss there?
Edit
Maybe you forgot to stage.removeChild(box)?
Old
When you add box
in holder
you have to convert its "global" (stage) position to a "local" (holder) position using the globalToLocal method.
var global : Point = new Point(box.x, box.y);
var local : Point = container.holder.globalToLocal(global);
container.holder.addChild(box);
box.x = local.x;
box.y = local.y;
精彩评论