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);
What do I miss there?
Maybe you forgot to stage.removeChild(box)?
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;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.