Hello, I am trying to use XML object that I want to create and pass around and parse it at the receiving end and I can't get this simple code working. Any help is greatly appreciated.
Here is the code. It says "xmlVar.MyEvent.x" can't be resolved. I tried the lower case as well? but if I dump the xmlVar, it does display the xml tree correctly. I just can't seem to access the nodes.what is wrong with this code? <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()"> <mx:Script> <![CDATA[ public function initApp():void { trace("initApp"); var xmlVar:XML = <MyEvent> <x>10</x> <y>20</y> </MyEvent> trace(xmlVar.MyEvent.x); } ]]> </mx:Script> </mx:Application>