# Loading External swf Issue

**URL:** <https://forum.kirupa.com/t/loading-external-swf-issue/301028>\
**Category:** flash\
**Created:** [December 2, 2009, 4:43pm UTC](https://forum.kirupa.com/t/loading-external-swf-issue/301028 "2009-12-02T16:43:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![doodark](https://avatars.discourse-cdn.com/v4/letter/d/57b2e6/32.png) [@doodark](https://forum.kirupa.com/u/doodark)\
**Post date:** [December 2, 2009, 4:43pm UTC](https://forum.kirupa.com/t/loading-external-swf-issue/301028/1 "2009-12-02T16:43:11Z")

</div>

Hi There,

I am trying to load an external swf (Banner Rotator) to an existing swf (website).  
My problem is that the banner rotator I am trying to add totally changes the display of my site which I had coded to resize to browsers and remain central.

Here is the live website before I have added the Banner Rotator:  
[www.samuelkarlbohn.com](http://www.samuelkarlbohn.com)  
and this is what happens to it after I add the code:  
[http://sarah-hammond.co.uk/sam\_test/Testing.html](http://sarah-hammond.co.uk/sam_test/Testing.html)

This is the code I used to load the external swf, it is within a an MC within an MC on the stage:

```auto
var my_loader:Loader = new Loader();
  my_loader.load(new URLRequest("PowerRotator.swf"));
  addChild(my_loader);

```

As you can see, the site is centred, and fits to browser window using this code: in the 3rd frame of the main .fla:

```auto
stop();
  import fl.transitions.Tween;
  import fl.transitions.easing.*;
  import fl.transitions.TweenEvent;
   
  var swfWidth:int = myStage.stageWidth;
  var swfHeight:int = myStage.stageHeight;
  var myStage:Stage = this.stage;
  myStage.scaleMode = StageScaleMode.NO_SCALE;
  myStage.align = StageAlign.TOP_LEFT;
  var main_mcYPos:Number = swfHeight - main_mc.height;
  var main_mcXPos:Number = swfWidth - main_mc.width;
  main_mc.y = main_mcYPos / 2;
  main_mc.x = main_mcXPos / 2;
   
  function resizeDisplay(event:Event):void {
              var swfWidth:int = myStage.stageWidth;
              var swfHeight:int = myStage.stageHeight; 
              var menu2YPos:Number = swfHeight - menu2.height;
              var main_mcYPos:Number = swfHeight - main_mc.height;
              var main_mcXPos:Number = swfWidth - main_mc.width;
              var tweenMenu2Y:Tween = new Tween(menu2, "y", Elastic.easeOut, menu2.y, menu2YPos, 1.2, true);
                          
  }
   
  myStage.addEventListener(Event.RESIZE, resizeDisplay);

```

The banner rotator is XML based, and has a folder called classes containing:  
Banner, Main Application and a com folder containing some .as files for motion/dynamics. If this is of any relevance.

Has anyone come across something like this before, or know what I am doing wrong?  
I am utterly confused as to how to sort this out, and am getting very close to my deadline (2 days away!).

Any help is greatly appreciated!

Many Thanks in advance,

Sarah
