如何最大限度地缩短 Flash 项目的构建时间?
使用 Flash/Flex 项目时最烦人的事情之一是构建项目需要很长时间。在我正在做的 Flash 游戏中,构建它需要超过一分钟......
所以,问题很简单:这正常吗?我做错了什么吗?有没有办法尽量减少这种情况?
One of the most annoying things when working with Flash/Flex projects is that it takes soo long to build the project. In a Flash game I am doing, it takes more than one minute to build it...
So, the question is simple: Is that normal? Am I doing something wrong? Is there a way to minimize this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
避免较长构建时间的常见方法是将项目划分为多个项目,并在主项目中将它们作为 SWC 进行引用。
实际上,较短的构建时间通常被认为是积极的副作用,因为任何较大的项目确实应该分为多个项目。通常,您将有多个库项目,处理服务层/控制器等。
通过这种方式,您可以将控制器/游戏逻辑移动到一个项目。这会导致更改之间的间隔较长,因此您可以关闭该项目,仅构建您当前正在使用的项目。
如果您使用 Flash 等中的大量资源。将它们也移至 SWC。
A common way of avoiding the long build-times is to divide your project up into multiple projects and reference them in as SWC's in a Main project.
Actually the shorter build times are mostly considered a positive side effect, as any larger project really ought to be divided into multiple project. Typically you will have more than one library project, handling the service layer/ controller ect.
This way you could for move the controller/ game logic to one project. This would have longer intervals between changes, and therefore you could close this project, building only the one you are currently working in.
If you are using a lot of assets from Flash ect. move those to a SWC as well.
一个简单的技巧可以缩短 Flash IDE 的编译时间:转到“发布设置”>“发布设置”>“发布设置”。动作脚本 3.0 >设置>禁用“警告模式”
此模式检查您是否正在使用 ActionScript 2.0 函数。如果您知道自己在做什么(不是将 as2.0 代码复制/粘贴到 as3.0 项目中),那么您将永远不需要这些“警告”。
另一个技巧是使用大量的 SWC:如果您使用的是补间引擎或框架;其中大多数都以 SWC 文件形式提供。使用它们。
A simple tip that makes compile time from the Flash IDE a bit shorter: Go to 'publish settings' > actionscript 3.0 > settings > disable 'Warnings Mode'
This mode checks if you are using actionscript 2.0 functions. If you know what you are doing (not copy/paste as2.0 code into as3.0 projects), you'll never need these 'warnings'.
Another tip is to use lots of SWC's: if you are using a tweenengine or a framework; most of them are available as SWC files. Use them.
是的,这很正常。如果您的项目变得越来越大,则可能需要更多时间。
我有一个 Flex 项目,完整构建(使用 ANT 而不是 Flex 构建器)需要 4 分钟。
关于这个问题,我能给你的最好建议是 SSD 驱动器,安装在我的 Mac 上的 SSD 驱动器可以将时间缩短 50% 以上。
Yes, it is normal. it can take more if your projects get bigger and bigger.
I have a flex project that a full build (using ANT not flex builder) takes 4 minutes.
The best advice I can give you on the subject and is an SSD drive, an SSD drive installed on my Mac cut the times by more then 50%.
我发现嵌入资产往往会大大延迟构建时间。一开始几乎不会被注意到,但一段时间后它们开始堆积并且构建时间增加。
也许可以尝试尽可能推迟嵌入资产。
I've found embedding assets tends to delay build times considerably. It's hardly noticeable at first but after a while they start stacking up and build time increases.
Maybe try delaying embedding assets a long as you can.