Hello !
here is the piece of code :
class Mp3Player {
var obj:Object;
var cXML:XML;
var playliste:String;
//
function Mp3Player(playliste:String, obj:Object) {
trace("constructor call");
this.playliste = playliste;
this.obj = obj;
init();
}
function init():Void {
trace("function init");
loadXML(onXmlLoaded);
}
function loadXML(funcOnLoaded):Void {
trace("function loadxml");
cXML = new XML();
cXML.onLoad = function(success) {
if (success) {
funcOnLoaded.apply(this.obj, [this]);
}
};
cXML.load(this.playliste);
}
function onXmlLoaded(xmlobj) {
trace("onXmlLoaded");
xml2arr(xmlobj);
}
function xml2arr(xmlobj) {
trace("function xml2arr");
display();
}
function display() {
trace("displaying player mp3");
}
}
in my fla:
var liste = new Mp3Player("my.xml",this);
the output expected:
constructor call
function init
function loadxml
onXmlLoaded
function xml2arr
displaying player mp3
real ouput:
constructor call
function init
function loadxml
onXmlLoaded
no way to see the xml2arr function nor the display function…
i do not see clearly why…
maybe a pb with the apply (this.obj…), the scope of this.obj inside the onLoad ?
tofu