开发者

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

开发者 https://www.devze.com 2023-01-09 04:19 出处:网络
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 chil

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

精彩评论

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