Flex项目VS ActionScript项目的缺点?项目、缺点、Flex、ActionScript

2023-09-08 11:25:25 作者:放白鹿于林间

我最近开始做一个游戏的弹性生成。本场比赛目前的Flex项目。

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

有没有什么缺点使用Flex,而不是仅仅的Actionscript?

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编译器产生大量的中间code到MXML文件转换为动作(可以查看这些文件,如果您编译与 -keep 编译器选项)。这code,纳入到您的SWF Flex框架,显著增加了尺寸。 在一个文本框(世界你好),并且使用相同的文字标签的Flex项目创建ActionScript项目。建立他们,去他们的货仓调试文件夹和比较文件的大小。虽然动作一个是只有几个千字节的,柔性的SWF将至少为100 KB。 至于速度方面,由于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.

 
精彩推荐
图片推荐