Hello and thanks for your time. Consider the following scaled down example of a much larger application:
I have text areas with id attributes and click events:
<mx:TextArea click="launchMyPopUp(event);" id="box1" text="blahblahblah"/>
<mx:TextArea click="launchMyPopUp(event);" id="box2" text="blahblahblah"/>
<mx:TextArea click="launchMyPopUp(event);" id="box3" text="blahblahblah"/>
These trigger the following function:
private function launchMyPopUp(e:MouseEvent):void{
var myId:String = e.currentTarget.id;
var win:Window = new Window();
win.title = myId;
win.sourceId = myId;
PopUpManager.addPopUp(win,this,true);
PopUpManager.centerPopUp(win);
}
This works well. A popup window appears with public var 'sourceId' injected into a label tag. So I know I'm getting the id attribute value of the selected item (either box1, box2, or box3) into the popup window.
Enter the sample XML File:
<gallery>
<car id="box1">
<pic>camaro1.jpg</pic>
<title>Camaro 1</title>
<date>1997</date>
</car>
<car id="box2">
<item>box2</item>
<pic>camaro2.jpg</pic>
<title>Camaro 2</title>
<date>1998</date>
</car>
<car id="box3">
<item>box3</item>
<pic>camaro3.jpg</pic>
<title>Camaro 3</title>
<date>1999</date>
</car>
What I would like to see is when the text areas are clicked their respective id value is passed to the popup window function, which is then used to get the related child data from the xml file and displays it in the popup (which is TitleWindow component).
I've gotten as far as to see the passed id in a label tag in the popup:
<mx:Label text="{sourceId}"/>
I am not sure how to talk to the xml file with the id value. I've tried a myriad of options and have failed miserably. Any help will be greatly appreciated. Cheers!