开发者

AS3/Flex Decorator Pattern

开发者 https://www.devze.com 2023-01-12 01:54 出处:网络
I\'m trying to create a decorator class in AS3/Flex in order to add some functionality to a UI element. The problem is that I don\'t 开发者_Python百科know how to automatically \"redirect\" method and

I'm trying to create a decorator class in AS3/Flex in order to add some functionality to a UI element. The problem is that I don't 开发者_Python百科know how to automatically "redirect" method and property calls to the object being decorated. I suppose I'm looking for something like the __call() "magic method" from PHP, which is called every time the application calls a non-callable method.

So, the question is - how do I redirect calls for methods and properties (which aren't overriden/don't exist in the decorator class) to the object being decorated?


I think the closest to magic methods in actionscript would be extending Proxy.

0

精彩评论

暂无评论...
验证码 换一张
取 消