简体   繁体   中英

Single-swf preloader wrapper in Flash

I have a .swf that I'd like to create a preloader for. In the end, I want a single file which combines both the preloader and the content .swf.

Every tutorial I can find on Flash preloaders offers one of two options:

  1. Using a URLRequest in the preloader wrapper to load an external content .swf. This will not work because I do not want two .swfs.

  2. A "single-swf" solution like this one which works for assets which you have created in the Flash IDE. I assumed I would easily be able to go this route, but I'm having trouble. I cannot use the Flash IDE to import my content .swf. I can use an embed tag like so:

     [Embed(source="content.swf")] private var MyContent:Class; 

    But it seems like this embedded content is exported on the first frame, so my preloader only appears after the content .swf is loaded. I'm guessing it's something along these lines. Any thoughts?

But it seems like this embedded content is exported on the first frame

You are absolutely correct, all Ebmed do embedding in the first frame by default but mxmlc provides solution by creating two frames swf with preloader in the first frame via the metatag:

[Frame(factoryClass="Preloader")]

You can find step by step guide here http://www.bit-101.com/blog/?p=946 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM