# Problem with loading new movie

**URL:** <https://forum.kirupa.com/t/problem-with-loading-new-movie/314186>\
**Category:** Uncategorized\
**Created:** [September 21, 2010, 8:07am UTC](https://forum.kirupa.com/t/problem-with-loading-new-movie/314186 "2010-09-21T08:07:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![uusrand](https://avatars.discourse-cdn.com/v4/letter/u/6a8cbe/32.png) [@uusrand](https://forum.kirupa.com/u/uusrand)\
**Post date:** [September 21, 2010, 8:07am UTC](https://forum.kirupa.com/t/problem-with-loading-new-movie/314186/1 "2010-09-21T08:07:49Z")

</div>

Hallo!

I like to play external preloader before it’s load original movie index.swf.  
But I have a problem on resizing index movie.  
Sample files on link [http://www.uusrand.eu/galerii/proov/Sample.zip](http://www.uusrand.eu/galerii/proov/Sample.zip)

Thanks

Here is preload AS3 code:

_package  
{  
import flash.display._  
import flash.display.MovieClip;  
import flash.net.URLLoader;  
import flash.net.URLRequest;  
import flash.net.navigateToURL;  
import flash.net.URLVariables;  
import flash.events.\*;  
import flash.events.Event;  
import flash.events.MouseEvent;  
import flash.display.StageScaleMode;  
import flash.display.StageAlign;  
import flash.display.Sprite;

```
public class Preload extends MovieClip
{
    private var LOADED_CONTENT:Loader = new Loader();*

```

- 

```
   public function Preload()
  {
      LOADED_CONTENT.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, INDEX_LOADING);
      LOADED_CONTENT.contentLoaderInfo.addEventListener(Event.COMPLETE, INDEX_LOAD_COMPLETE);
      LOADED_CONTENT.load(new URLRequest("index.swf"));
  }*

```

- 

```
   private function INDEX_LOADING(e:ProgressEvent):void
  {
      mc1.text = int(e.bytesLoaded / e.bytesTotal * 100) + "%";
  }*

```

- 

```
   private function INDEX_LOAD_COMPLETE(e:Event):void
  {
      LOADED_CONTENT.contentLoaderInfo.removeEventListener(ProgressEvent.PROGRESS, INDEX_LOADING);
      LOADED_CONTENT.contentLoaderInfo.removeEventListener(Event.COMPLETE, INDEX_LOAD_COMPLETE);
      removeChildAt(0);
      addChild(LOADED_CONTENT);
  }

```

}  
}\*

And here is index AS3 code:

_package  
{  
import flash.display._  
import flash.display.MovieClip;  
import flash.net.URLLoader;  
import flash.net.URLRequest;  
import flash.net.navigateToURL;  
import flash.net.URLVariables;  
import flash.events._;  
import flash.events.Event;  
import flash.events.MouseEvent;  
import fl.motion.easing._;  
import flash.display.StageScaleMode;  
import flash.display.StageAlign;  
import flash.display.Sprite;

```
public class Index extends MovieClip
{
    public static var SCREEN_SIZE_W:Number;
    public static var SCREEN_SIZE_H:Number;*

```

- 

```
   public function Index()
  {
      stage.scaleMode = StageScaleMode.NO_SCALE;
      stage.align = StageAlign.TOP_LEFT;
      STAGE_RESIZE(null);
      stage.addEventListener(Event.RESIZE, STAGE_RESIZE);
      stage.dispatchEvent(new Event(Event.RESIZE));
  }*

```

- 

```
   private function STAGE_RESIZE(e:Event):void
  {
      if (stage.stageWidth &lt; 500)
      {
          SCREEN_SIZE_W = 500;
      }
      else
      {
          SCREEN_SIZE_W = stage.stageWidth;
      }
      if (stage.stageHeight &lt; 400)
      {
          SCREEN_SIZE_H = 400;
      }
      else
      {
          SCREEN_SIZE_H = stage.stageHeight;
      }*

```

- 

```
       mc2.width = SCREEN_SIZE_W - 100;
      mc2.height = SCREEN_SIZE_H - 100;
      mc2.x = SCREEN_SIZE_W / 2;
      mc2.y = SCREEN_SIZE_H;
  }

```

}  
}\*
