You can call a function from the parent MXML document as:
if(this.parentDocument.parentFunction!= null){
this.parentDocument.parentFunction(param1);
}
But this is not a good practice. Can be handled using events.
Another not so good way for a component to call a function from the top level application:
mx.core.Application.application.funcToCall(params);
Use TitleWindow class+PopUpManager class to make a modal window. TitleWindow well suited. Has a showCloseButton property.
To create a popup using PopUpManager, use PopUpManager.createPopUp(parent, popUpWinClass, isModal); This method returns IFlexDisplayObject.
Use PopUpManager.removePopUp(this); to execute the actual close ie removing the popup.
UIComponent -> Container, Button, NumericStepper, ComboBase
Container -> Box, Form
Box -> VBox, HBox
ComboBase -> ComboBox
Questions:
- Your child component need to call a function from the parent component. How will you handle it?
- A component needs to call a function from the top level application. How can this be done?
- How would you work on making a popup?
- What is syntax for the for loop in AS3.0?
No comments:
Post a Comment