Tags
Athena Framework
Archives
-
Recent Posts
-
Tag Archives: Event
Flex Event stopimmediatepropagation VS stoppropagation
What’s the difference ? Here is the test codes: We will create a button in a Group, and listen the button click event(MouseEvent.Click): protected function windowedapplication1_creationCompleteHandler(event:FlexEvent):void { // Create button and container var hbox:HGroup = new HGroup(); var button:Button = …
Flex 自定义Event 低级错误一例: 未重写Clone方法, 导致类型转换失败
自定义Event必须及时重写Clone与toString方法….
Flex中使用currentStateChange事件监听State变化
使用currentStateChange Event监听State改变事件.
关于FlexBuilder的Event注释
如果某个类派发某事件, 我们通常使用如下注释: /** * Dispatched when …. * @eventType com.events.MyEvent.EVENT_TEST */ [Event(name=”myEvent” type=”com.events.MyEvent”)] 在使用new testr().addEvent…时提示的Const是错误的.MyEvent.MY_EVENT 解决方法: [Event(name=”eventTest” type=”com.events.myevent”)] 此时的提醒为MyEvent.EVENT_TEST []中的name应与Event中的const的名字 如EVENT_TEST:String = "myEvent"; 中的EVENT_TEST对应 ,’_"后的字母保留大写去掉下划线->eventTest即可. 注意: Flex框架中的事件, 其Const 与String的name都是想对应的. ==>不得不承认 这样子比较挫<== 所以在编写自定义事件时, 最好也遵守这个不成文的规定: public static const EVENT_EO_EDITOR:String = …
Flex中addEventListener失败原因总结
我绝对是个粗心大意的人, 写代码90%的时间是浪费在低级错误上. 今天不幸又add错一把, 索性将犯错原因归纳如下: 1.弱智级别:***** 隔着锅台上炕: 没有dispatch就addEventListener 2.弱智级别:**** 驴唇不对马嘴: addEventListener中Event类型不符 3.弱智级别:*** 驴唇不对马嘴: Listener参数中Event类型不符[FleBuilder会在编译时报错] 4.弱智级别** 脑子让驴踢了: 在addEventListener之前就dispatch Event[不太容易发现] 自定义事件常见错误: 1. Type不使用Const的String 2. 构造函数中super(type…)中type填写错误.


