Let me start with saying - I haven't done much AS3 and havent worked with the document class before.
What im trying to do is simple:
- Have a timeline animation along with the document class
In my document class, im loading some XML (see snippet)
Here im extending my class as a Sprite which means I can only have one frame on my timeline.
What would my approach be to this?
- Should I add the entire animation into a movieclip, give it a linkage name and add it to the displaylist?
- Or am I able to extend my class otherways, so I can actually have animation on the main timeline?
// import needed classes
// we extend sprite instead of movieclip as no timeline is needed
public class xmlLoad extends Sprite
// our xml object
private var xml:XML;
public function xmlLoad()
private function readXML():void
// load the xml file using the URLLoader class
var loader:URLLoader = new URLLoader(new URLRequest("dataFeed.xml"));
// call our xmlLoaded function once the xml has loaded
private function xmlLoaded(e:Event):void
// assign loaded xml structure to our xml object
xml = new XML(e.target.data);
xml.ignoreWhitespace = true;