使用皮肤而不嵌入 CSS 文档和 Flex 中的 swf
我遇到的问题是创建一个应用程序,几乎每个组件都使用 CSS 进行皮肤处理。大多数组件都使用以下方式进行蒙皮: 嵌入(源=“文件.png”); 方法。我遇到的问题是 flex 试图将所有嵌入资源编译到最终的 swf 中。就目前情况而言,我编译的 swf 大约有 16mb!@@ 哎呀。这是一个非常大的应用程序,但不是那么大。关于如何在运行时或根据请求将资源加载到应用程序中的任何想法?
The issue I am having is creating an application with nearly every component skinned using CSS. The majority of the components are skinned using:
Embed(source="file.png");
method. The problem I am running into, is flex trying to compile all of the embedded assets into the final swf. As it stands now, my compiled swf stands around 16mb!@@ OUCH. It is a very large application, but not that big. Any ideas on how to load the assets into the application at run time, or on request maybe?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,没有一种简单的方法可以在运行时动态加载皮肤资源。最有可能的问题是 PNG 没有得到很好的优化。在 Flex 中使用它们之前,您可以手动优化它们。或者您也可以尝试 Joa 的 Apparat 工具,它可以自动优化 SWF 中的图像。或者可能更痛苦的选择是从位图切换到矢量艺术。
AFAIK there isn't an easy way to load skin assets dynamically at runtime. Most likely the problem is that the PNG's aren't optimized well. You can manually optimize them before you use them in Flex. Or you can try Joa's Apparat tool that automatically optimizes the images in a SWF. Or probably a much more painful option is to switch from bitmap to vector art.
谢谢!
我确实浏览并重做了许多图像。事实证明,我正在为其他矢量皮肤导入多个 SWC 文件。 Flex 不喜欢这样的编译时间,并且一直吐出“内存不足”错误。此外,我还为组件使用了两个不必要的名称空间,现在已清除。编译器现在运行良好,一切运行顺利。感谢您的帮助!
Thanks!
I did go through and redo many of the images. As it turns out, I was importing multiple swc files for other vector skins. Flex did not like this a compile time, and kept spitting out an "out of memory" error. In addition, I was also using two unnecessary name spaces for components, which is now cleared up. The compiler is now working well, and everything is running smoothly. Thanks for your help!