Dear Swapna/Raj,
I have one more solution for you requirement, might not be the best but works for me.
If you are displaying other mxml components in main mxml .... create the other mxml components as MXML Modules.
and on click event callback in your main mxml of some button or link load the MXML module as bellow
var currentModule:IModuleInfo = ModuleManager.getModule("OtherMxml1.swf");
currentModule.addEventListener(ModuleEvent.READY, OtherMxml1EventHandlers); //you can have event listeners for each otherMxml component.
And in OtherMxmlEventHandlers function
============================================
private function OtherMxml1EventHandler (e:ModuleEvent):void {
var currentScreenForm:Object = currentModule.factory.create() as OtherMxml1;
mainPanel.removeAllChildren(); // Main Panel is Panel in the Maim mxml file.
mainPanel.addChild(currentScreenForm as DisplayObject);
}
If you are using Flex Builder then creating mxml modules is very easy and will be loaded only when required. You can also unload the module to free up the memory.The compilation of modules would be taken care by FB and can be optimized to Main MXML.
I am sorry if I am not very clear. I posted some snippet of code from my project. Hope this helps you a bit.