开发者

Is it possible to call a function in a parent component from a child component in Flex?

I need to call a function located in the parent component and make the call from the child component in Flex 3. Is the开发者_如何学JAVAre a way to access functions in the parent component from the child component? I know I can dispatch an event in the child and add a listener in the parent to call the function, but just wanted to know if could also directly call a parent function from a child. Thanks


You can use parentApplication

For example... if i have a main.mxml that calls a component we'll call child.mxml, i can call functions in main from within child by doing the following:

parentApplication.parentsFunctionName(parameters);
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜