开发者

Move the externally loaded content of a MovieClip to another MovieClip

开发者 https://www.devze.com 2023-03-22 14:52 出处:网络
I load an image into a MovieC开发者_高级运维lip. At a second time I want to move this image to another MovieClip. Is this possible? How?yes, that\'s possible.

I load an image into a MovieC开发者_高级运维lip. At a second time I want to move this image to another MovieClip. Is this possible? How?


yes, that's possible.

just re-parent the image using removeChild() and addChild():

var loader:Loader = new Loader();
loader.load(new ULRRequest("pathToImage.jpg"));

movieclip1.addChild(loader);

// sometime later ...
movieclip1.removeChild(loader);  // optional
movieclip2.addChild(loader);

voilà ...

0

精彩评论

暂无评论...
验证码 换一张
取 消