load swf file at (X,Y) position
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.
精彩评论