The XMLConnector() class is part of the XMLConnector component that is included with Flash MX 2004 Professional and only useable by FLAs created in MX2004pro. The class can be used to create a RSS feed reader in flash and is extremely useful for loading XML files from external domains. In order to use the class the component must be added to the library of the project first. Then ActionScript can be used to create an XML connection via the class. After a new instance of the class is created the developer can assign a specific XML URL to it and a connection can be triggered to force the Flash project to read the file.
Code sample and explanation after the jump.
To use the component first give your code access to the component in the library:import mx.data.components.XMLConnector;
Then create an instance of the XMLConnector class:var actionScriptAfternoon:XMLConnector = new XMLConnector();
The component can be set to receive, send, or send and receive XML. Set it to receive if only creating an RSS reader. actionScriptAfternoon.direction = “receive”;
Set the location of the XML file.actionScriptAfternoon.URL = "ttp://www.flashinsider.com/rss.xml"
The following will keep the connector from trying to connect to the file more than once at the same time.actionScriptAfternoon.multipleSimultaneousAllowed = false;
This will keep the connector from stopping the entire Flash project from working if it can’t connect to the XML file.actionScriptAfternoon.suppressInvalidCalls = true;
Lastly the connection must be triggered so the connector knows when to run.actionScriptAfternoon.trigger();
Some developers don’t like the XMLConnector class because it runs slower than the XML class, but the XML class is unable to access files on external sites without special permission so the XMLConnector class is a better choice for creating XML readers unless you want to dive into PHP.







1. to get into an array view of the data use the technote referring to the results property of the component here:
http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00003049.html
the comments after the technote may be very helpful as well.
Posted at 10:47AM on Dec 2nd 2005 by Michael Schleifstein