Click here to Skip to main content
15,887,350 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I need to learn actionscript in flash for new information media. I have a swf called banner.swf and main.swf. After run main.swf, the page will load banner.swf into it to play the banner(advertisement). So how do I get this? I have some code but not sure. I want to resize the specific width and height so the banner.swf not mess to run in whole main.swf scene..

This is AS3 code which run good. But i want it on AS2.
C#
import flash.display.StageDisplayState;

var swfLoader:Loader = new Loader();
mc_container.addChild(swfLoader);
var bgURL:URLRequest = new URLRequest("banner.swf");
swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadProdComplete);
swfLoader.load(bgURL);

function loadProdComplete(e:Event):void {

    var temp_scaleX:Number = mc_container.scaleX;
    var temp_scaleY:Number = mc_container.scaleY;
    mc_container.scaleX = 1.1;
    mc_container.scaleY = 1.1;
    swfLoader.height = mc_container.height;
    swfLoader.width = mc_container.width;
    mc_container.scaleX = temp_scaleX;
    mc_container.scaleY = temp_scaleY;
}


Can someone give me a link to it? I search and not found good solutions on this.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900