开发者

load swf file at (X,Y) position

开发者 https://www.devze.com 2023-02-10 05:28 出处:网络
Greeting, I have the listed code to load swf file to the stage using action script 3 and I want to modify it to place the swf in (X,Y) place.

Greeting, I have the listed code to load swf file to the stage using action script 3 and I want to modify it to place the swf in (X,Y) place.

what I should add to the code to have the swf file placed in the specify position.

Thank you,

var swfLoader:Loader = new Loader();

stage.addChild(swfLoader);

var bgURL:URLRequest = ne开发者_开发百科w URLRequest("test.swf");

swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);

swfLoader.load(bgURL);

function loadProdComplete(e:Event):void {

trace("file loaded");

}


you need to add:

after stage.addChild(swfLoader);

swfLoader.x = 100;
swfLoader.y = 100;

That should be it. Of course 100 is to be replaced with the values you need.

0

精彩评论

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