Hey there,
I am trying to make a new portfolio site for myself and I have a preloader.swf that loads the main.swf. The structure of the main flash looks like this:
Main.fla
Main.as
/ui
Nav.as
Body.as
/utils
fullscreenScrollBar.as
BitmapLoader.as
In the Main.as, I have this in the constructor:
// setup stage
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
stage.addEventListener(Event.RESIZE, onResize);
When I play the preloader.swf, however, some error occurs and fails to load. Without the stage properties, the whole thing works fine. How can I add stage properties while using an external swf for preloader?
My preloader is just one fla with actionscript on timeline.
just a simple loader:
var mLoader:Loader = new Loader();
var mRequest:URLRequest = new URLRequest("Main.swf");
mLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);
mLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onProgressHandler);
mLoader.load(mRequest);
function onCompleteHandler(loadEvent:Event) {
removeChild(mc_preLoader);
this.addChild(loadEvent.currentTarget.content);
}
function onProgressHandler(mProgress:ProgressEvent) {
var percent:Number = Math.round(mProgress.bytesLoaded*100/mProgress.bytesTotal);
mc_preLoader.gotoAndPlay(percent);
mc_preLoader.txt_number.text = percent;
}