简体   繁体   English

在Flash中加载SWF

[英]Loading swf in flash

I get more information around in internet about how it do, but I have problem how right including in my "flash load external swf" the "as3 xml full stream gallery" . 我在Internet上获得了有关其工作方式的更多信息,但是我在“ flash load external swf”中包括“ as3 xml full stream gallery”是否正确。 And how to focus gallery in centre. 以及如何将画廊集中在中心。

Loading is easy enough: 加载非常简单:

var loader:Loader = new Loader();
loader.load(new URLRequest("myFlashThing.swf"));
addChild(loader);

I'm not sure what you mean by "how focus gallery in center" but if you want to center it: 我不确定“如何将焦点放在中心”是什么意思,但是如果您想将其居中:

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;
}

(untested, but its something along those lines) (未经测试,但遵循这些原则)

If you're using MVC, this link will save you; 如果您使用的是MVC,此链接将为您节省;

CodeVoyeur 偷窥狂

It even has a sample mvc project that you can refer to. 它甚至有一个示例mvc项目,您可以参考。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM