views:

203

answers:

1

I have 2 mxml files, lets say main.mxml and child.mxml. Now lets say I want to load child.mxml inside main.mxml and pass it a complex object as a parameter. How would I go about doing this in AS3/Flex 3?

I have tried to search for this on Google and SO but either I am not searching with the right keywords or there is no info (unlikely).

Cheers

EDIT: I am not looking for the mxml to be JIT compiled, loading the compiled mxml as swf is fine.

+2  A: 

You want to do this using Modules. You can keep main.mxml as your root Application but child.mxml needs to be defined a Module component. You can then use ModuleLoader to load the child app. Here's a good place to get started:

http://livedocs.adobe.com/flex/3/html/help.html?content=modular_2.html

cliff.meyers
Thanks BRD, modules was exactly what i needed. In case anyone else comes accross this, to pass data between movies the reference is here: http://livedocs.adobe.com/flex/3/html/help.html?content=modular_7.html
Darko Z