Groups | Blog | Home
all groups > flash data integration > october 2005 >

flash data integration : xml driven CDrom?


ewyglend
10/25/2005 12:00:00 AM
I am working on a CDrom (built in flash) that has easily outdatable content.
Instead of offering weblinks for all of the text content, I'd like to have the
CDrom call up xml from a web location that can be updated. The problem I am
running into is this: what happens when someone doesn't have an internet
connection or the server is down? I'd like to have a backup XML document on the
CDrom that is called up if the web XML document cannot be found. I tried
googling this and looking at other forums, but I couldn't find any documention
on anyone else attempting this. I am nothing near an ActionScript expert, so
any suggestions would be helpful.
Thanks in advance,
Liz
*
10/25/2005 3:13:21 PM
On Tue, 25 Oct 2005 14:43:28 +0000 (UTC), "ewyglend"
[quoted text, click to view]


var x:XML = new XML();

x.onLoad = function(bSuccess:Boolean):Void
{
if (bSuccess) {
// Success, load data from server
} else {
// Failure, load data from CD
}
};


// Swap out this URL with your own...
x.load("http://localhost/locations.xml");
Chrononaut
10/28/2005 11:32:21 PM
I just did this; here's what I did:

myXML = new XML();
myXML.onLoad = function (success) {
if (success) {
// you're good
} else {
// load from local source... myXML.load("local filename")
}
}
myXML.load("remote filename");

Hope that helps.
ewyglend
10/29/2005 12:00:00 AM
AddThis Social Bookmark Button