I am getting a value in a MXML... now i need to pass it to another MXML to invoke an event... how can i do it.
It can be done like this Test.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public var a:String;
]]>
</mx:Script>
</mx:Application>
Test2.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script>
<![CDATA[
public var a1:String;
public var te1:Test=new Test();
public function init():void{
a1=te1.a;
}
]]>
</mx:Script>
</mx:Application>
this is not right i think but it may serve your purpose
Assuming one MXML component is the child of the other, you should be using binding to pass data around.
You could dispatch an event containing the string value from the source component to be received by the destination component.
You need to explain more about how your two mxml components relate to each other... parent/child? two siblings within a parent? That will determine the best approach. Of course, your components should not really be "wired into each other" if possible, which is where frameworks such as Mate come in, but that is probably way beyond where you're at just now.
i want to pass values from one mxml page to other.......can anyone give me a soln?