Flex的事件C#里的事件相比还是有很大不同的,其中没有代理的概念。
看几段as的代码。
第一步继承Event类,实现自己的事件
Flex的事件package lib 
第二步,类定义何时触发事件
Flex的事件package lib
}

实例化类,并建立监听
Flex的事件            public function Init():void
            }

关于给事件监听方法传递更多参数的问题,Flex的帮助原文如下

Passing additional parameters to listener functions

You can pass additional parameters to listener functions depending on how you add the listeners. If you add a listener with the addEventListener() method, you cannot pass any additional parameters to the listener function, and that listener function can only declare a single argument, the Event object (or one of its subclasses).
If you define an event listener inline (inside the MXML tag), you can add any number of parameters as long as the listener function's signature agrees with that number of parameters.

相关文章:

  • 2021-07-08
  • 2021-09-08
  • 2021-12-07
  • 2021-06-22
  • 2021-12-08
  • 2021-09-15
  • 2022-12-23
猜你喜欢
  • 2021-09-07
  • 2022-01-28
  • 2021-07-16
  • 2022-03-08
  • 2021-04-20
  • 2022-01-24
相关资源
相似解决方案