Agris
Agris

Reputation: 1

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" . And how to focus gallery in centre.

Upvotes: 0

Views: 186

Answers (1)

Zevan
Zevan

Reputation: 10235

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)

Upvotes: 1

Related Questions