Código PHP:
//*********************************************************************
// flash vA1.00
//*********************************************************************
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}//end func
//*********************************************************************
for (var i = 0; i < 100; i++) {
var n:Number = randRange(536, 539)
}//end for
//*********************************************************************
if(n == "536"){
var w_hoppye = "http://xxxx/code20.txt";
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if(success){
txt.text = "Servidor 1 OK";
texto.text = w_hoppye;
fscommand("",w_hoppye);
}else{
txt.text = "Servidor 1 Caido !";
stop();
var nInterval = setInterval(Play, 6000);
function Play() {
txt.text = "Buscando !";
clearInterval(nInterval);
}//end func
gotoAndPlay("1");
}//end if
};//end func
my_lv.load(w_hoppye);
}//end if
//*********************************************************************
if(n == "537"){
var w_hoppye = "http://xxxx/code20.txt";
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if(success){
txt.text = "Servidor 2 OK";
texto.text = w_hoppye;
fscommand("",w_hoppye);
}else{
txt.text = "Servidor 2 Caido !";
stop();
var nInterval = setInterval(Play, 6000);
function Play() {
txt.text = "Buscando !";
clearInterval(nInterval);
}//end func
gotoAndPlay("1");
}//end if
};//end func
my_lv.load(w_hoppye);
}//end if
//*********************************************************************
if(n == "538"){
var w_hoppye = "http://xxxx/code20.txt";
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if(success){
txt.text = "Servidor 3 OK";
texto.text = w_hoppye;
fscommand("",w_hoppye);
}else{
txt.text = "Servidor 3 Caido !";
stop();
var nInterval = setInterval(Play, 6000);
function Play() {
txt.text = "Buscando !";
clearInterval(nInterval);
}//end func
gotoAndPlay("1");
}//end if
};//end func
my_lv.load(w_hoppye);
}//end if
//*********************************************************************
if(n == "539"){
var w_hoppye = "http://xxxx/code20.txt";
var my_lv:LoadVars = new LoadVars();
my_lv.onLoad = function(success:Boolean) {
if(success){
txt.text = "Servidor 4 OK";
texto.text = w_hoppye;
fscommand("",w_hoppye);
}else{
txt.text = "Servidor 4 Caido !";
stop();
var nInterval = setInterval(Play, 6000);
function Play() {
txt.text = "Buscando !";
clearInterval(nInterval);
}//end func
gotoAndPlay("1");
}//end if
};//end func
my_lv.load(w_hoppye);
}//end if
//*********************************************************************
stop();
al final hice algo asi... pero es demasiado codigo para añadir 20 por ejemplo....
alguien sabe como reducir esto...