[英]Loading swf in flash
我在Internet上獲得了有關其工作方式的更多信息,但是我在“ flash load external swf”中包括“ as3 xml full stream gallery”是否正確。 以及如何將畫廊集中在中心。
加載非常簡單:
var loader:Loader = new Loader();
loader.load(new URLRequest("myFlashThing.swf"));
addChild(loader);
我不確定“如何將焦點放在中心”是什么意思,但是如果您想將其居中:
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
function onLoad(evt:Event):void{
loader.x = stage.stageWidth / 2 - loader.content.width / 2;
loader.y = stage.stageHeight / 2 - loader.content.height / 2;
}
(未經測試,但遵循這些原則)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.