Skip to main content
March 4, 2011
Question

Load external SWF file into another SWF

  • March 4, 2011
  • 1 reply
  • 967 views

Hello all.

I've tried loading a .swf file externally into another .swf file on my  local drive, and it works. Now, when I try to Simulate Download, the  preloader in the 2nd file doesn't get played and the images in there  take a while to get displayed.

I need to load a .swf file from a server into the parent .swf file(I'm  working on using a "thin flash file" for added security for the company I  work for - blank file which loads the content from another file on  their server).

So far, I have:


try
{
    var myLoader:Loader = new Loader();
    addChild(myLoader);
    var url:URLRequest = new URLRequest("newBook.swf");
    myLoader.load(url);
}   
catch (e:Error)
{
    trace("ruhroh");
}

When I replace the "newBook.swf" with the URL of another .swf, there's just a blank page.

I'm not too sure how to proceed, and I hope you will be able to help me out. I'd greatly appreciate the help.

Many thanks,

-Nazgul

This topic has been closed for replies.

1 reply

Inspiring
March 4, 2011

You have to manually slow down the simulated network bandwidth (default is T1)to actually see a progress (under simulate download use download options) when loadinmg smaller assets

March 5, 2011

What happens is...when I set the speed to DSL(32.6kbps), the screen is blank and the preloader doesn't show up. It just goes directly to the Main screen. And then, the pages inside don't get loaded properly.

This only happens when I try to Simulate Download.

But that's not really the problem. I need to load a .swf file from a server into another .swf file, and just adding the link to the child .swf isn't working.

Anyway, thanks for your help

-Nazgul