云自无心水自闲

天平山上白云泉,云自无心水自闲。何必奔冲山下去,更添波浪向人间!
posts - 288, comments - 524, trackbacks - 0, articles - 6
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

Flex2.0与1.5的区别

Posted on 2006-03-01 01:31 云自无心水自闲 阅读(1285) 评论(3)  编辑  收藏 所属分类: Flex

Flex2.0不再仅仅是Web应用或者显示服务器。它是一个框架。

你不再需要象Flex1.5那样需要一个Server,不需要在浏览器的URL中输入mxml后缀的请求来查看。可以直接把SWF文件放到Web目录下即可。这一句话是重点啊。

这意味着什么呢? Flex开始免费了!!
因为Flex将免费发布Flex SDK,即可以免费将mxml编译生成swf
在Flex2.0不需要再象1.5那样需要Flex的Server了。

Don't think of Flex as a web application or a presentation server any more. It isn't. Flex 2 is a lot more. And the heart of Flex 2 is the framework. 
Flex Framework 2, as it's officially called, is a programming model, a set of components and class libraries that make building Rich Internet Applications easy. 
This framework is included with the all new Eclipse-based Flex Builder 2 IDE. There is still a server component in the Flex 2 product line, 
Flex Enterprise Services 2, but its capabilities are focused around messaging and enterprise data services. 

You read that right. With Flex 2 you won’t need to purchase a server to build applications that use Flex Framework. 
This might take a little getting used to, because you've been putting MXML files into a web directory and requesting them with a browser to see how they run. 
Well, you don't need to do that anymore. What you do now is either run them from within Flex Builder 2 or use the command-line compiler mxmlc. 

The end result is a SWF file that you deploy inside your favorite web server. 

修改分为以下几个部分:
一.使用方法上2.0与1.5是不同的, 比如: Application.alert() 修改为 Alert.show()
二.增加了存取限制符, 即public, private, ...  更加强化了OO的概念
三.添加了类型限定. 所有的变量,属性,方法,返回值都必须指定类型,
        在1.5中: var s = "page"; 是可以的, 但是在2.0中必须写成: public var s:String = "page";
四.事件的修改
    派发自定义事件时必须new Event而不是使用通用对象, 比如: click="dispatchEvent(new Event('checkOut'))"
    监听器不再需要Delegate了, 1.5中 b1.addEventListener(“click”, mx.utils.Delegate.create(this,myListener));
        在2.0中可以改为:b1.addEventListener(MouseEvent.CLICK, myListener);
五. 所有的ActionScript组件都要封装到package中, 可以使用匿名package, 但是package语句必须是组件定义文件的第一行.
package {
  public class MyClass {
  // Class definition
  }
} // Close package
六. RemoteObject在2.0中不能继续使用了.
七. 图形组件, 在2.0中如果要使用图形,必须下载单独的swc

八. ActionScript由2.0升级为3.0
九. Flex Framework进行了升级修改, 部分类被新类所代替, 比如:MediaDisplay被VideoDisplay取代.






评论

# re: Flex2.0与1.5的区别   回复  更多评论   

2006-03-29 17:25 by ola
"六. RemoteObject在2.0中不能继续使用了."
是不是因为
"你不再需要象Flex1.5那样需要一个Server"
而导致的

因为RemoteObject还需要一个Server来支持
好像是说RemoteObject还是可以用 不过他并不是免费的

习惯了RemoteObject的说 没有他还真是不习惯阿

# re: Flex2.0与1.5的区别   回复  更多评论   

2006-03-30 09:27 by 云自无心水自闲
@ola
是的. Flex2.0中把RemoteObject分离出来单独成为一个组件, 如果想使用是要购买的.
但好象也不是完全的收费.

据了解好象是允许5个以下的RemoteObject访问, 可以作为学习和试验之用.

# re: Flex2.0与1.5的区别   回复  更多评论   

2006-04-01 15:24 by usherlight
We're also going to release a free version of Flex Enterprise Services that will be limited by the number of connections it allows, and will only run on a single server. Of course, Flex Builder 2 and the full version of Flex Enterprise Services 2 won't be free

FlexBuilder2和完整版的Flex Enterprise Service2(在Beta2中已经更名为Flex Data Services, 简称FDS)是不会免费的. 但是会提供一个限制连接数的版本, 而且只能一台服务器上使用.

只有注册用户登录后才能发表评论。


网站导航: