File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Flex and the fly likes Calling one mxml file from another Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Flex
Bookmark "Calling one mxml file from another" Watch "Calling one mxml file from another" New topic
Author

Calling one mxml file from another

Neelima Mohan
Greenhorn

Joined: May 23, 2010
Posts: 27
hi,

Can we call 1 mxml from another mxml? How to we do it?
Any pointers to it would be much appreciated.

Thanks,
Neelima
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes. Create an instance of whatever component your mxml file defines and there you go.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Neelima Mohan
Greenhorn

Joined: May 23, 2010
Posts: 27
I have 1 mxml file which contains couple of components...this is like 1 screen...on clicking the next button it should call another mxml with a different set of components like 2 textfield etc....how to implement this navigation?

Thanks,
Neelima
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

What type do these mxml files define? Canvases? Panels? Applications?

Neelima Mohan
Greenhorn

Joined: May 23, 2010
Posts: 27
one file is 1 mxml with an application tag and a canvas within it. I want to call this mxml to call yet another mxml which again has a canvas details inside an application tag. this is to emulate a screen flow.

Visualize this requirement as a data entry form. On screenload the user types in data into the fields defined in the first mxml. There is a next button. On click of the next button the next mxml will be called and the fields defined in that second mxml gets displayed to the user. User types in the details and then finally clicks the save button to make a call to the service layer.

I am not able to get information on how to call 1 independent mxml from another mxml.

Thanks,
Neelima
Narender Reddy Soma
Greenhorn

Joined: Jun 05, 2010
Posts: 23
I think States would help, try googling Flex States.

and Inorder to call one mxml from another, you can do in two ways.

one is you can import the mxml as other class like Panel,Canvas etc and invoke method on it.
and another is compiling the dependant mxml and embed as local file.

Think which option would fit your requirement?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling one mxml file from another
 
Similar Threads
Flex 3: Appropiate way for creating a Module Component
calling javascript function from ActionScript Method
did anybody try fiji
How will XML change the software industry?
Navigate from one mxml to another mxml