A Flash Developer Resource Site

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    8

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

    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 :


    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.
    [IMG]s17.postimage.org/8anikq765/bad_banner_blurred.png[/IMG]


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

    I just do this :

    Code:
    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:
    Here are the 'bad' banners that make my player go crazy:
    Can anyone help me figure out how to prevent this from screwing up my player, please ?
    Thank you for everyone who can help !

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,424
    You should not be able to see anything if the Loader is not added as a Displayobject no matter which movie you load. I tested a good and a bad movie and there was no problem. May be there is an addChild method in the loaded swfs to load something to the stage. When the swf is loaded the parent stage will be its stage also. I have never had experience with that and actually I should get the same result. So as conclusion I think the problem is in your movie.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts




Click Here to Expand Forum to Full Width


HTML5 Development Center