Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE FLASH: HomeFlash ForumFlash TutorialsFlash Video TutorialsWeb Streaming ForumAdobe FlashPodcast

xmlSocket help

COW Forums : Adobe Flash

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
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.

Thanks!

Respond to this post   •   Return to posts index

Re: xmlSocket help
by Mike Smith on Nov 3, 2009 at 11:14:20 am

I was wondering why you want to open a socket rather than simply try to load an xml file, and act on success or failure ...

Respond to this post   •   Return to posts index

Re: xmlSocket help
by Sol Martin on Nov 3, 2009 at 12:59:17 pm

I'm making an enhanced cd that will load content off live pages, but if the program can't initially find the website, then it will load off of the cd.

This is the perfect air project I can't do!

Respond to this post   •   Return to posts index


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.

If all this is new to you, there's quite a bit to take on. The links below are intended to be helpful - if you already know all this stuff, then my apologies.
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/a...
http://www.actionscript.org/resources/articles/9/1/XML-101/Page1.html
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/a...
http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/a...

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]