简体   繁体   English

Flash中的单SWF预加载器包装器

[英]Single-swf preloader wrapper in Flash

I have a .swf that I'd like to create a preloader for. 我有一个要为其创建预加载器的.swf文件。 In the end, I want a single file which combines both the preloader and the content .swf. 最后,我想要一个包含预加载器和内容.swf的文件。

Every tutorial I can find on Flash preloaders offers one of two options: 我可以在Flash预加载器上找到的每个教程都提供以下两个选项之一:

  1. Using a URLRequest in the preloader wrapper to load an external content .swf. 在预加载程序包装器中使用URLRequest加载外部内容.swf。 This will not work because I do not want two .swfs. 这将不起作用,因为我不需要两个.swfs。

  2. A "single-swf" solution like this one which works for assets which you have created in the Flash IDE. 这样的 “单swf”解决方案适用于您在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. 我无法使用Flash IDE导入内容.swf。 I can use an embed tag like so: 我可以这样使用embed标签:

     [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. 但是似乎此嵌入式内容在第一帧上导出,因此我的预加载器仅加载内容.swf 之后出现。 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: 您是完全正确的,默认情况下,所有Ebmed都会在第一帧中进行嵌入,但是mxmlc通过使用Ebmed在第一帧中使用预加载器创建两个帧swf来提供解决方案:

[Frame(factoryClass="Preloader")]

You can find step by step guide here http://www.bit-101.com/blog/?p=946 . 您可以在http://www.bit-101.com/blog/?p=946上找到分步指南。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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