why wouldn’t this work as an AS2.0 class? the ‘myXml’ value always comes up undefined. i’ve established that it is loading the xml file and i’ve tried local and online xml files and i’m just stuck… i’m new to class building.
thanks for your help.
the as file…
class com.news.newsXML
{
//
private var myXml:XML;
//
public function newsXML()
{
init();
}
//
private function init():Void
{
trace("init();");
myXml = new XML();
myXml.ignoreWhite = true;
myXml.onLoad = parseNews;
myXml.load("any.xml");
}
//
private function parseNews():Void
{
trace("Function: parseNews();");
trace("myXml == " + myXml);
}
}
in the fla…
import com.news.newsXML;
var newsObj:newsXML = new newsXML();