xmlSocket help
by Sol Martin
on
Nov 2, 2009 at 7:21:30 pm
Hi there,
I am unsure the best way to do this: I am making a standalone flash .exe, that when connected to the internet will load one frame, and when not connected, will load another frame.
My current code does this:
var xmlSocket:XMLSocket=new XMLSocket();
xmlSocket.onConnect=function() {
xmlSocket.send(new XML("TESTING CONNECTION"));
}
xmlSocket.onXML=function(myXML) {
trace(myXML.firstChild.childNodes[0].firstChild.nodeValue);
xmlSocket.close();
}
xmlSocket.connect("http://www.websiteurl.com");
And would like it to finish doing this, but in a way that works:
if XMLSocket == connected {
_root.gotoAndPlay(2);
}
else {
_root.gotoAndPlay(3);
}
Any suggestions on the best way to add this? AS2.0, Flash CS3.
Re: xmlSocket help by Mike Smith on Nov 3, 2009 at 2:09:26 pm
It sounds to me like you don't need a socket (live communication with an xml socket server, programming at the server end to communicate) but could perhaps make it work with an xml file which holds the content, or links to the content, that you want to load.
So you might want to load an xml document and parse it into a Flash xml object, then use data from that object to supply text for your dynamic text fields, or images to load into movieclips.