This piece of code gives a brief idea of how to work with multiple window. Invoking an application(mxml) from other applications(mxml).This piece is different from pop up window. Pop up window is a pre-defined class while creating a window application is user defined application.
In this example, I am calling ChildWindow.mxml from ParentWindow.mxml.
Call child Window
ParentWindow
in "<mx:Script>"
Declare the intance of the child
private var newChild:ChildWindow;
initialize the instance
newChild= new ChildWindow();
to open the window
newChild.open();
ChildWindow
ChildWindow should be of Window component type (
declare the variable in the ChildWindow. When creating the instance, initialize the variable from the mainwindow. For example, to pass the value "yaazh" to the variable "name" of the child window, the code is given below
in ChildWindow
declare variable name in "<Script>"
in ParentWindow when creating intance of the ChildWindow, assign the value to the variable of the ChildWindow instance.
newChild= new ChildWindow();
newChild.name="yaazh";
newChild.open();
this will work :-)
No comments:
Post a Comment