开发者

Using events vs. directly calling parent application function from a child in Flex / Flash Builder

开发者 https://www.devze.com 2023-03-14 18:27 出处:网络
If I need to call a specific function in the parent application from a child in a flex project, what\'s the best practice for this?Would it be to dispatch a custom event from the child and have a list

If I need to call a specific function in the parent application from a child in a flex project, what's the best practice for this? Would it be to dispatch a custom event from the child and have a listener call that function? Or to directly call the function with FlexGlobals.topLevelApplicatio开发者_如何学Gon?


OOP would say that Events are the way to go, since globals are anti-OOP and also since the event at least promotes some level of separation between the caller and the callee.

0

精彩评论

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