# Stage and preloader problem

**URL:** https://forum.kirupa.com/t/stage-and-preloader-problem/294530
**Category:** Uncategorized
**Created:** [August 15, 2009, 7:55pm UTC](https://forum.kirupa.com/t/stage-and-preloader-problem/294530 "2009-08-15T19:55:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![myoreo](https://avatars.discourse-cdn.com/v4/letter/m/7feea3/32.png) [@myoreo](https://forum.kirupa.com/u/myoreo)
#### Post date: [August 15, 2009, 7:55pm UTC](https://forum.kirupa.com/t/stage-and-preloader-problem/294530/1 "2009-08-15T19:55:38Z")

</div>

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:

```auto

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;
    }

```
