Flash Video Player

Loading external XML files

by admin on May 2, 2007 · 0 comments

in Flash CS3, Flash CS3 and XML, Tutorials

With Actionscript 3.0 the XML Class seems to have deeply changed.
The XML class has been moved to the package flash.xml and its name has been changed to XMLDocument to avoid the conflict with the new XML Class, which has been enriched with the ECMAScript for XML.
I’ll begin with saying that the load() and onLoad() methods of AS 2.0 have been removed, therefore we now use the URLLoader and URLRequest classes to load an external XML file.
You add a listener to the instance of URLLoader and at the COMPLETE event, the XML parsing begins, hence you pass the data of the URLLoader’s instance to a new instance of the XML class, then you create a new instance of the XMLDocument class, which helps parsing the XML instance.

Read more

Share This Post

Related posts

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

Older post: Best way to instance the Document Class

Newer post: onRelease removed