# Player changes size after external SWF is just loaded (but not used)

**URL:** <https://forum.kirupa.com/t/player-changes-size-after-external-swf-is-just-loaded-but-not-used/330045>\
**Category:** flash\
**Created:** [November 22, 2012, 3:49pm UTC](https://forum.kirupa.com/t/player-changes-size-after-external-swf-is-just-loaded-but-not-used/330045 "2012-11-22T15:49:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flivor2012](https://avatars.discourse-cdn.com/v4/letter/f/22d042/32.png) [@Flivor2012](https://forum.kirupa.com/u/Flivor2012)\
**Post date:** [November 22, 2012, 3:49pm UTC](https://forum.kirupa.com/t/player-changes-size-after-external-swf-is-just-loaded-but-not-used/330045/1 "2012-11-22T15:49:38Z")

</div>

I have a flash player I am working on.  
The stage (and player) size are 640x979.  
At the bottom of the player I have a control-bar, with play-pause buttons etc.  
Here is an image of the player ([http://s14.postimage.org/asbpyr373/good\_banner\_blurred.png](http://s14.postimage.org/asbpyr373/good_banner_blurred.png))  
 ![](http://s14.postimage.org/asbpyr373/good_banner_blurred.png)

So far so good.

Now - on most external SWFs that I load - they load OK.  
But on some - if I try to load them using the Loader class - the player goes crazy !  
The control bar dissappears, and the video is stretched in a funky way. You can see this in the attached image ([http://s17.postimage.org/8anikq765/bad\_banner\_blurred.png](http://s17.postimage.org/8anikq765/bad_banner_blurred.png))  
 ![](http://s17.postimage.org/8anikq765/bad_banner_blurred.png)

What is really strange here is - this happens even if I don’t add the Loader object as a child !

I just do this :

```auto

public function PlayerCtor()
{
    swfUrlLoader = new Loader();
    swfUrlLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onSwfReceived);    
    swfUrlLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onSwfIOError);

    swfUrlLoader.load(new URLRequest(swfUrl));
}

private function onSwfReceived(e:Event):void
{
    swfUrlLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, onSwfReceived);    
    swfUrlLoader.contentLoaderInfo.removeEventListener(IOErrorEvent.IO_ERROR, onSwfIOError);
}

```

That’s it ! I don’t do anything else besides just loading the external SWF !

The only things that I can think about are:

1. maybe the ‘bad’ SWF files have some code-behind in them that causes this behavior to happen ?
2. the ‘bad’ banners are supposed to be 906x340. I have noticed that they have animations flying in from ‘outside’ those boundries … (I found this out by decompiling the SWFs using ‘Flash Decomplier’ trial).

Here are the SWF banners that are OK and don’t do any problems:  
[LIST]  
[_][http://speedy.sh/QSYa5/adom-adom.swf](http://speedy.sh/QSYa5/adom-adom.swf)  
[_][http://speedy.sh/yCaTx/mama-off-tnuva.swf](http://speedy.sh/yCaTx/mama-off-tnuva.swf)  
[_][http://speedy.sh/BYTsz/maadanot.swf](http://speedy.sh/BYTsz/maadanot.swf)  
[_][http://speedy.sh/rasJu/sanfrost.swf](http://speedy.sh/rasJu/sanfrost.swf)  
[/LIST]  
Here are the ‘bad’ banners that make my player go crazy:  
[LIST]  
[_][http://speedy.sh/xbRCF/cheese.swf](http://speedy.sh/xbRCF/cheese.swf)  
[_][http://speedy.sh/zGSYp/eggs.swf](http://speedy.sh/zGSYp/eggs.swf)  
[_][http://speedy.sh/uRCaZ/emek-cheese.swf](http://speedy.sh/uRCaZ/emek-cheese.swf)  
[_][http://speedy.sh/QSYT5/milk.swf](http://speedy.sh/QSYT5/milk.swf)  
[/LIST]

Can anyone help me figure out how to prevent this from screwing up my player, please ?  
Thank you for everyone who can help !
