Hi All
Im working on my first AS3 class, but are stocked with a problem.
My idea is to make a xml class, where i gave the url for the xml doc in the flash files.
my class right now look like:
package classes {
public class xmlClass {
public var xmlMenu:XML;
public var xmlContent:XML;
public var [url:String](http://www.kirupa.com/forum/String);
public function xmlClass([url:String](http://www.kirupa.com/forum/String)=""){
var xmlLoader:URLLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, showXML);
xmlLoader.load(new URLRequest(url));
}
public function showXML(e:Event):void {
trace("XML Loaded");
XML.ignoreWhitespace = true;
var xmlMenu:XML = new XML(event.target.data);
var xmlContent:XML = new XML(event.target.data);
}
}
}
And my flash look like
import classes.xmlClass;
var xml:xmlClass = new xmlClass("xml/main.xml");
But i cant get it to work :S
i get the output:
1046: Type was not found or was not a compile-time constant: Event.
I really hope somebody can help!
cheers!
/rosenberg