i guys,
i’ve a problem with the resizing to the browser of a swf. I preload this swf that have in one layer a movieclip that contains the main animation and in the above layer this actionscript:
ActionScript Code:
[LEFT]
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, resizingCont);
function resBack() {
var mainWD = stage.stageWidth / 2;
var mainHG= stage.stageHeight / 2;
mcmain.x = mainWD;
mcmain.y = mainHG;
mcmain.width = stage.stageWidth;
mcmain.height = stage.stageHeight;
mcmain.scaleX <= mcmain.scaleY ? (mcmain.scaleX = mcmain.scaleY) : (mcmain.scaleY = mcmain.scaleX);
}
resBack();
function resizingCont(event:Event):void {
resBack();
}
[/LEFT]
The preloader:
[COLOR=#993300]
[/COLOR]
[COLOR=#993300]
[COLOR=Black]var l:Loader = new Loader();
[/COLOR] [/COLOR][LEFT] [COLOR=#993300][COLOR=Black]l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);
l.load(new URLRequest("main.swf"));
function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
mcmainprel.preloadText.text = Math.ceil(perc*100).toString() + " %";
mcmainprel.preloadBar.width = Math.ceil(perc*100);
}
function done(e:Event):void
{
removeChildAt(0);
mcmainprel.preloadText = null;
addChild(l);
}[/COLOR]
[/COLOR][/LEFT]
Does the resizing actionscript is loaded when the preload load the swf “main.swf”? Because it seems no. In fact when the preload end its process and load main.swf the code in the first layer (the above code i’ve posted here) for resizing it and adapting to the browser page seems that it’s not working. seems that it jump that code. How can i do?
This is very important…