为什么我的标准 RSL 没有加载?
我创建了一个模块化应用程序,其中父 SWF 按需加载许多其他 SWF。为了优化,我创建了标准 RSL。
我已将通用代码编译到 swc 中,并重新编译应用程序 swf 以引用此 swc,在我的 build.xml ANT 任务中使用以下内容(对于我的应用程序中的每个 swf):
<static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
<runtime-shared-library-path path-element="${lib.loc}/RSL.swc">
<url rsl-url="RSL.swf"/>
</runtime-shared-library-path>
我已从 RSL.swc 中提取了 RSL.swf并将其放在我的网络服务器上与应用程序 swfs 和容器 html 文件相同的目录中。
现在,当我加载应用程序时,我收到消息:
VerifyError: Error #1014: Class mx.core:BitmapAsset could not be found.
我可以看到此类包含在 RSL.swc / RSL.swf 中的类中。
我使用 fiddler 来观察发生的情况,我可以看到我的应用程序 swf 文件已加载,但没有尝试获取 RSL.swf。
设置 Application.swf 文件以使用 RSL 后,我希望它在初始化之前尝试加载 RSL.swf,但是这并没有发生。谁能建议为什么?
I've created a modular application where a parent SWF loads a number of other SWFs on demand. For optimization, I've created a standard RSL.
I've compiled common code into a swc, and recompiled the application swfs to reference this swc, using the following in my build.xml ANT task (for each swf in my application):
<static-link-runtime-shared-libraries>false</static-link-runtime-shared-libraries>
<runtime-shared-library-path path-element="${lib.loc}/RSL.swc">
<url rsl-url="RSL.swf"/>
</runtime-shared-library-path>
I've extracted RSL.swf from RSL.swc and put this on my webserver in the same directory as the application swfs and container html file.
Now when I load my application, I get the message:
VerifyError: Error #1014: Class mx.core:BitmapAsset could not be found.
I can see this class included in the classes in RSL.swc / RSL.swf.
I've used fiddler to observe what is happening and I can see my Application swf file is loaded, but no attempt is made to get the RSL.swf.
Having set up the Application.swf file to use RSLs, I would have expected it to attempt loading RSL.swf before initialising, however this doesn't happen. Can anyone suggest why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自 http://livedocs.adobe.com/flex/ 3/html/help.html?content=rsl_02.html:
“如果基类是 Sprite 或 MovieClip,则不能在仅限 ActionScript 的项目中使用 RSL。RSL 要求应用程序的基类,例如 Application 或SimpleApplication,了解 RSL 加载。”
由于我的基类是 Sprite,所以我遇到了这个错误。
就我而言,最好使用以下步骤将所有必需的类编译到我的应用程序 swf 文件中:
实现步骤 1:
实现步骤 2:
实现步骤 3:
另一个方便的提示:使用 fork="true" 可以防止 Java VM 在编译许多 swf 时耗尽内存。
希望这有帮助!
From http://livedocs.adobe.com/flex/3/html/help.html?content=rsl_02.html:
"You cannot use RSLs in ActionScript-only projects if the base class is Sprite or MovieClip. RSLs require that the application's base class, such as Application or SimpleApplication, understand RSL loading."
As my base class was Sprite, I had this error.
In my case, it was better to compile all the required classes into my Application swf file, using the following steps:
To achieve step 1:
To achieve step 2:
To achieve step 3:
Another handy tip: using fork="true" prevents the Java VM running out of memory where many swfs are being compiled.
Hope this is helpful!