Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : need help LoadVars() function


Dimak
5/18/2004 11:24:23 PM
Hello
i need some advise on this one!
i am trying to load some variables from file

variaables.txt
u know that there is a function for this



myData = new LoadVars()
myData.load("variaables.txt")


but i have these vriable.txt files on 3 different servers for the purpose of
one of these gets down

domain1.com/variaables.txt
domain2.com/variaables.txt
domain3.com/variaables.txt

how to make a function using if and elseif to force script to try get the
variables from one server then from the other ?

any advices are welcome
hope hearing from you!

thanks!@

sneakyimp
5/18/2004 11:58:37 PM
Dimak
5/19/2004 12:32:49 AM
Thanks for respond
but i think you are mistaking my friend it is possible please check search on
crossdomain.xml you will see and by the way i have managed to make this
script up if you need it post %)

see yA
sneakyimp
5/19/2004 12:44:23 AM
if you are having success checking the various domains, then all you need to do
is read the documentation on loadvars. when you set the onload function of a
loadVars object, that function is called with an argument, "success" which is
true or false.

maybe like this:
lvarFormSubmit = new LoadVars();
lvarFormSubmit.arg = "this doesn't matter because you're just loading a text
file";

function myOnLoad(success) {
trace("myOnLoad running");
trace("success")
if (success) {
trace("SERVER RESPONSE FN success is true");
} else {
trace("Server query failed");
// try the next one
}
} // myOnLoad()
lvarServerResponse = new LoadVars();
lvarServerResponse.onLoad = myOnLoad;
strInitPage = "http:/domain1.com/args.txt";
// this refers to the function above.
lvarFormSubmit.load(strInitPage, lvarServerResponse, "POST");

ps: i hope you're not sending spam mail.
S1n0Byt3}:
5/19/2004 12:47:57 AM
Yes it is possible through flash, but vert prohibitive in terms of execution.
It is a pain. If you are running either ASP or PHP it is possible to create a
ping script. I would be careful of how you do, because your NT system may
detect it as a possible virus and systematically shut the port. Make sure that
you use a fie key encryption for the exchange of information.
AddThis Social Bookmark Button