# Preloader in preloaded swf

**URL:** <https://forum.kirupa.com/t/preloader-in-preloaded-swf/312603>\
**Category:** Uncategorized\
**Created:** [August 8, 2010, 6:49pm UTC](https://forum.kirupa.com/t/preloader-in-preloaded-swf/312603 "2010-08-08T18:49:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaqqb](https://avatars.discourse-cdn.com/v4/letter/j/b9bd4f/32.png) [@jaqqb](https://forum.kirupa.com/u/jaqqb)\
**Post date:** [August 8, 2010, 6:49pm UTC](https://forum.kirupa.com/t/preloader-in-preloaded-swf/312603/1 "2010-08-08T18:49:42Z")

</div>

it is possible to modify this code to see preloader pleased in first frame of stronka.swf?

```auto

    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLRequest;
    import flash.events.Event;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    

        var container:Sprite;
        
        function Main(){
            
            container = new Sprite();    
            this.addChild(container);
            var url:URLRequest = new URLRequest("stronka.swf");
            var loader:Loader = new Loader();
            loader.load(url);
            

            
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler);
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, tloLoad);
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, tloLoad2);
            loader.contentLoaderInfo.addEventListener(Event.COMPLETE, bub);
        
            
            this.stage.scaleMode = StageScaleMode.NO_SCALE;
            this.stage.align = StageAlign.TOP_LEFT;
                
            
        }
                    
        function completeHandler(event:Event):void{            
            this.container.addChild(event.target.content);
            this.container.height = this.stage.stageHeight;
            this.container.width = this.stage.stageHeight * 1.33;
            
            this.container.x = (this.stage.stageWidth/2) - ((this.stage.stageHeight * 1.33) /2);
            this.container.y =0;
            
            
            this.stage.addEventListener(Event.RESIZE, resizeHandler);
        }
        
        function resizeHandler(event:Event):void{
            this.container.height = this.stage.stageHeight;
            this.container.width = this.stage.stageHeight * 1.33;
            
            this.container.x = event.target.stage.stageWidth/2 - (this.stage.stageHeight * 1.33) /2;
            this.container.y = event.target.stage.stageHeight/2 - this.stage.stageHeight /2;
            
            
        }
        
function tloLoad(event:Event):void{            
    //this.container.addChild(event.target.content);    
    tlo.alpha=100;
    tlo.height = this.stage.stageHeight;
    tlo.width = 2+(this.stage.stageWidth - (this.stage.stageHeight * 1.33))/2;
    tlo.x = this.stage.stageWidth - (2+(this.stage.stageWidth - (this.stage.stageHeight * 1.33))/2);
    tlo.y = 0;
    
    this.stage.addEventListener(Event.RESIZE, resizeHandler2);
}

function tloLoad2(event:Event):void{            
    //this.container.addChild(event.target.content);    
    tlo2.alpha=100;
    tlo2.height = this.stage.stageHeight;
    tlo2.width = 2+(this.stage.stageWidth - (this.stage.stageHeight * 1.33))/2;
    tlo2.x = this.stage.x;
    tlo2.y = this.stage.y;
    
    this.stage.addEventListener(Event.RESIZE, resizeHandler3);
}
    
function resizeHandler2(e:Event):void
{
    tlo.height = this.stage.stageHeight;
    tlo.width = 2+(this.stage.stageWidth - (this.stage.stageHeight * 1.33))/2;
    tlo.x = this.stage.stageWidth - (2+(this.stage.stageWidth - (this.stage.stageHeight * 1.33))/2);
      tlo.y = 0);
}

function resizeHandler3(e:Event):void
{

    tlo2.height = this.stage.stageHeight;
    tlo2.width = 2+(this.stage.stageWidth - (this.stage.stageHeight * 1.33))/2;
    tlo2.x = this.stage.x;
    tlo2.y = this.stage.y;

}
Main();

```

I was trying to replace loader.contentLoaderInfo.addEventListener(Event.COMPLETE, completeHandler) with something different but any result ☹

I’m new in as3
