Loader載入外部圖片
AS2 loadMovie -> AS3 Loader中的load()
透過load()可動態的載入外部的檔案,如:jpg、swf、gif..等(需透過movieclip)
------------------------------------------------------------------------------
var _ldr:Loader = new Loader();
var _file:String=”載入圖片的名稱.jpg”;
_ldr.load(new URLRequest(_file));
loadmc.addChild(_ldr);
/*loadmc是舞台上用來載入的movieclip的instance name*/
------------------------------------------------------------------------------
via:梅問題教學網
addChild
With AS3 ‘_global’ and ‘root’ are not longer valid markup.
.addChild() = TimeLine0.addChild() 相當於將mc加到stage(最上層)
Friday, 13 February 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment