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
* - 25 Oct 2005 23:13 GMT
>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
[quoted text clipped - 7 lines]
> Thanks in advance,
> Liz
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 - 29 Oct 2005 00:32 GMT
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 - 29 Oct 2005 18:12 GMT
Thanks, that seems to be exactly what I was looking for.