Flex 项目与 Actionscript 项目的优缺点? [英] Disadvantages of a Flex project vs an Actionscript project?

查看:25
本文介绍了Flex 项目与 Actionscript 项目的优缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近开始在 FlexBuilder 中制作游戏.该游戏目前是一个 Flex 项目.

I've recently started making a game in FlexBuilder. The game is currently a Flex project.

与仅使用 Actionscript 相比,使用 Flex 有什么缺点吗?

Is there any downside to using Flex as opposed to just Actionscript?

一个朋友的朋友告诉我 Flex 比 Actionscript 项目慢.我一直无法在互联网上验证这一点;这种说法有道理吗?

A friend of a friend told me that Flex is slower than an Actionscript project. I've been unable to validate this on the internet; is there any truth to that claim?

谢谢!

推荐答案

  • 如果您正在开发游戏,则应该使用 ActionScript 项目.Flex 仅用于数据驱动的应用程序和用户界面.
  • flex 编译器会生成大量中间代码来将 mxml 文件转换为 actionscript(如果使用 -keep 编译器选项进行编译,则可以查看这些文件).这段代码是合并到您的 SWF 中的 flex 框架,显着增加了大小.
  • 创建一个带有文本字段(hello world")的 actionscript 项目和一个带有相同文本标签的 flex 项目.构建它们,转到它们的 bin-debug 文件夹并比较文件大小.虽然动作脚本只有几千字节,但 flex swf 至少有 100 KB.
  • 就速度而言,由于 flex 框架位于 actionscript 之上,因此显然会有性能下降.
  • Flex 的美妙之处在于可以轻松创建 UI 组件和开发经常与服务器通信的数据驱动应用程序.
  • 除非确实需要,否则不要使用它.
    • If you're developing a game, you should be using an ActionScript project. Flex is to be used only for data driven applications and user interfaces.
    • The flex compiler generates a lot of intermediate code to convert mxml files into actionscript (you can view those files if you compile with -keep compiler option). This code, the flex framework incorporated to your SWF, adds significantly to the size.
    • Create an actionscript project with a textfield ("hello world") and a flex project with a label with the same text. Build them, go to their bin-debug folders and compare the file sizes. While actionscript one is only a couple of kilobytes, flex swf would be at least a 100 kB.
    • As far as speed is concerned, since the flex framework is sitting on top of actionscript, it obviously would have a performance downside.
    • The beauty of flex lies in the easiness to create UI components and developing data driven applications that frequently communicates with the server.
    • Don't use it unless you truly need it.
    • 这篇关于Flex 项目与 Actionscript 项目的优缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆