<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Dynamically loading external XML files using ActionScript 3.0</title>
	<atom:link href="http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/feed/" rel="self" type="application/rss+xml" />
	<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/</link>
	<description>A bunch of ActionScript 2.0 and ActionScript 3.0 examples*</description>
	<lastBuildDate>Thu, 22 Jul 2010 14:13:10 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Brad</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-604</link>
		<dc:creator>Brad</dc:creator>
		<pubDate>Mon, 26 Oct 2009 18:33:32 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-604</guid>
		<description>Nice article. How would one load an external XML file if there is just a URL which spits out XML? For example http://server/blah/xml.</description>
		<content:encoded><![CDATA[<p>Nice article. How would one load an external XML file if there is just a URL which spits out XML? For example <a href="http://server/blah/xml" rel="nofollow">http://server/blah/xml</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-581</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Thu, 20 Aug 2009 19:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-581</guid>
		<description>Oliver,

I believe the Loader class is used to load SWF or image files, not text files.
http://livedocs.adobe.com/flex/3/langref/flash/display/Loader.html

&lt;blockquote&gt;
The Loader class is used to load SWF files or image (JPG, PNG, or GIF) files. Use the &lt;code&gt;load()&lt;/code&gt; method to initiate loading. The loaded display object is added as a child of the Loader object. 
Use the URLLoader class to load text or binary data.
&lt;/blockquote&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Oliver,</p>
<p>I believe the Loader class is used to load SWF or image files, not text files.<br />
<a href="http://livedocs.adobe.com/flex/3/langref/flash/display/Loader.html" rel="nofollow">http://livedocs.adobe.com/flex/3/langref/flash/display/Loader.html</a></p>
<blockquote><p>
The Loader class is used to load SWF files or image (JPG, PNG, or GIF) files. Use the <code>load()</code> method to initiate loading. The loaded display object is added as a child of the Loader object.<br />
Use the URLLoader class to load text or binary data.
</p></blockquote>
<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Oliver</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-579</link>
		<dc:creator>Oliver</dc:creator>
		<pubDate>Thu, 20 Aug 2009 18:10:11 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-579</guid>
		<description>Is it possible to use &quot;Loader&quot; instead of &quot;URLLoader?&quot;</description>
		<content:encoded><![CDATA[<p>Is it possible to use &#8220;Loader&#8221; instead of &#8220;URLLoader?&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-544</link>
		<dc:creator>Peter deHaan</dc:creator>
		<pubDate>Thu, 25 Jun 2009 03:17:09 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-544</guid>
		<description>Ely Tejeda,

Try adding some unique token to the PHP script URL. Something like a timestamp.
&lt;pre lang=&quot;actionscript3&quot;&gt;
var targetURL:String = &quot;getXML.php?uid=&quot; + new Date().time;
&lt;/pre&gt;

Peter</description>
		<content:encoded><![CDATA[<p>Ely Tejeda,</p>
<p>Try adding some unique token to the PHP script URL. Something like a timestamp.</p>

<div class="wp_syntax"><div class="code"><pre class="actionscript3" style="font-family:monospace;"><span style="color: #6699cc; font-weight: bold;">var</span> targetURL<span style="color: #000000; font-weight: bold;">:</span><span style="color: #004993;">String</span> = <span style="color: #990000;">&quot;getXML.php?uid=&quot;</span> <span style="color: #000000; font-weight: bold;">+</span> <span style="color: #0033ff; font-weight: bold;">new</span> <span style="color: #004993;">Date</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #004993;">time</span>;</pre></div></div>

<p>Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ely Tejeda</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-543</link>
		<dc:creator>Ely Tejeda</dc:creator>
		<pubDate>Wed, 24 Jun 2009 17:05:03 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-543</guid>
		<description>Hello, i&#039;ve figured out how to read with flash a xml file generated by php, when you acces to it via a internet browser it generates a different xml file each time. But when im testing my movie with flash it keeps showing me the results as if it loaded the same xml each time, when i restart flash, it loads a different xml but when i test the movie again i get the same result. I think its a problem with the cachee configuration but i dont know exactly what cachee is... ive tried to set useCache=false; but it is a command only aviable for AIR. Any ideas?</description>
		<content:encoded><![CDATA[<p>Hello, i&#8217;ve figured out how to read with flash a xml file generated by php, when you acces to it via a internet browser it generates a different xml file each time. But when im testing my movie with flash it keeps showing me the results as if it loaded the same xml each time, when i restart flash, it loads a different xml but when i test the movie again i get the same result. I think its a problem with the cachee configuration but i dont know exactly what cachee is&#8230; ive tried to set useCache=false; but it is a command only aviable for AIR. Any ideas?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: deepa</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-530</link>
		<dc:creator>deepa</dc:creator>
		<pubDate>Fri, 05 Jun 2009 15:13:05 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-530</guid>
		<description>I want to send the xmlFile.xml file format. can you please post that file so that i can understand the flow</description>
		<content:encoded><![CDATA[<p>I want to send the xmlFile.xml file format. can you please post that file so that i can understand the flow</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: adarsh</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-520</link>
		<dc:creator>adarsh</dc:creator>
		<pubDate>Fri, 29 May 2009 10:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-520</guid>
		<description>hello, actually i want to dynamically access xml file and create tree struture in flex..and xml file having lots of child node</description>
		<content:encoded><![CDATA[<p>hello, actually i want to dynamically access xml file and create tree struture in flex..and xml file having lots of child node</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: R2-D2</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-506</link>
		<dc:creator>R2-D2</dc:creator>
		<pubDate>Tue, 12 May 2009 21:56:58 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-506</guid>
		<description>Uday, is as3 there an easy way to define the xml file through html?

In as2 I would treat it like this:
var urlRequest:URLRequest = new URLRequest(datasrc);

and in the html it would look like: myfilename.swf?datasrc=data.xml

Thanks in advance!</description>
		<content:encoded><![CDATA[<p>Uday, is as3 there an easy way to define the xml file through html?</p>
<p>In as2 I would treat it like this:<br />
var urlRequest:URLRequest = new URLRequest(datasrc);</p>
<p>and in the html it would look like: myfilename.swf?datasrc=data.xml</p>
<p>Thanks in advance!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Uday</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-33</link>
		<dc:creator>Uday</dc:creator>
		<pubDate>Thu, 20 Nov 2008 19:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-33</guid>
		<description>Here is the good Example:
var imagesXML:XML;
	var xmlImagesLoader:URLLoader=new URLLoader;
	xmlImagesLoader.load(new URLRequest(xmlFile.xml));
	xmlImagesLoader.addEventListener(Event.COMPLETE,loadImagesXML);
	var l:Number;
	var labelList:Array = new Array();
	var tooltipList:Array = new Array();
	var imageSourceList:Array = new Array();
	var imageLinkList:Array = new Array();

	function loadImagesXML(e:Event):void {
		imagesXML=new XML(e.target.date);
		l=imagesXML.children().length();
		for (var i=0; i&lt;l; i++) {
			labelList[i] = imagesXML.image[i].label.children();
			tooltipList.push(imagesXML.image[i].tooltip.children());
			imageSourceList[i] = imagesXML.image[i].imageSource.children();
			imageLinkList[i] = imagesXML.image[i].imageLink.children();
			
		}


	}

You can use the defined Array to any where to your flash application.

xmlFile.xml


	
		My &lt;b&gt;HOME&lt;/b&gt;
		My&lt;b&gt;HOME&lt;/b&gt;Page
		images/icon1.jpg
		http://google.com
	
	
		CARBURETORS
		Hello&lt;b&gt;Brother&lt;/b&gt;
		images/icon0.jpg
		http://google.com
	


Let me know if you have any doubt.

Thank,
Uday
uday_sgh@yahoo.com
Sr. Flash Developer
Hyderabad</description>
		<content:encoded><![CDATA[<p>Here is the good Example:<br />
var imagesXML:XML;<br />
	var xmlImagesLoader:URLLoader=new URLLoader;<br />
	xmlImagesLoader.load(new URLRequest(xmlFile.xml));<br />
	xmlImagesLoader.addEventListener(Event.COMPLETE,loadImagesXML);<br />
	var l:Number;<br />
	var labelList:Array = new Array();<br />
	var tooltipList:Array = new Array();<br />
	var imageSourceList:Array = new Array();<br />
	var imageLinkList:Array = new Array();</p>
<p>	function loadImagesXML(e:Event):void {<br />
		imagesXML=new XML(e.target.date);<br />
		l=imagesXML.children().length();<br />
		for (var i=0; i&lt;l; i++) {<br />
			labelList[i] = imagesXML.image[i].label.children();<br />
			tooltipList.push(imagesXML.image[i].tooltip.children());<br />
			imageSourceList[i] = imagesXML.image[i].imageSource.children();<br />
			imageLinkList[i] = imagesXML.image[i].imageLink.children();</p>
<p>		}</p>
<p>	}</p>
<p>You can use the defined Array to any where to your flash application.</p>
<p>xmlFile.xml</p>
<p>		My <b>HOME</b><br />
		My<b>HOME</b>Page<br />
		images/icon1.jpg<br />
		<a href="http://google.com" rel="nofollow">http://google.com</a></p>
<p>		CARBURETORS<br />
		Hello<b>Brother</b><br />
		images/icon0.jpg<br />
		<a href="http://google.com" rel="nofollow">http://google.com</a></p>
<p>Let me know if you have any doubt.</p>
<p>Thank,<br />
Uday<br />
<a href="mailto:uday_sgh@yahoo.com">uday_sgh@yahoo.com</a><br />
Sr. Flash Developer<br />
Hyderabad</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adam</title>
		<link>http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/comment-page-1/#comment-8</link>
		<dc:creator>Adam</dc:creator>
		<pubDate>Sat, 26 Jul 2008 02:34:58 +0000</pubDate>
		<guid isPermaLink="false">http://actionscriptexamples.com/2008/03/02/dynamically-loading-external-xml-files-using-actionscript-30/#comment-8</guid>
		<description>How can I use these same scripts but in a movie clip? It seems to be causing me problems to embed a dynamic text box in a movie clip layer.</description>
		<content:encoded><![CDATA[<p>How can I use these same scripts but in a movie clip? It seems to be causing me problems to embed a dynamic text box in a movie clip layer.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
