Cannot load XML
I dont know much about Parsing XML with AS2. Any idea why this doesnt work? "Game can now be started", "In loadXML function" is traced. Unfortunately, "failed to load" is traced too. I put my cards.xml file in the same file as my main.asc.
===============================================================
Server side (main.asc)
===============================================================
application.onConnect = function(clientObj){
application.acceptConnection(clientObj);
clientObj._uniqueUserID = this.userID;
this.userID++;
if(this.userID == 2)
{
trace("Game can now be started");
for (i = 0; i < application.clients.length; i++){
application.clients.call("startGame");
}
}
clientObj.loadXML= function(){
var cardData = new XML();
cardData.load("http://localhost/myapplication2/cards.xml");
trace("In loadXML function");
cardData.ignoreWhite = true;
cardData.onLoad = function(success){
if(success)
{
trace("xml loaded");
}
else
{
trace("failed to load");
}
}
}
}
====================================================
Client side
====================================================
function startGame():void
{
nc.call ("loadXML", null);
}
