Код: Выделить всё
var myXML0:XML = new XML(); var XML_URL0:String = hostway+"Reload.aspx?id="+viewerid+"&authkey="+authkey+"&passkey="+passkey;var myXMLURL0:URLRequest = new URLRequest(XML_URL0); var myLoader0:URLLoader = new URLLoader(myXMLURL0);var myTimer:Timer = new Timer(15000);myTimer.addEventListener(TimerEvent.TIMER, timerListener);function timerListener (e:TimerEvent):void{XML_URL0 = hostway+"Reload.aspx?id="+viewerid+"&authkey="+authkey+"&passkey="+passkey;myXMLURL0 = new URLRequest(XML_URL0);myLoader0 = new URLLoader(myXMLURL0); myLoader0.addEventListener("complete", xmlReload); }function xmlReload(event:Event):void { txthispoints.text="0"; myXML0 = XML(myLoader0.data); if(myXML0.card1=="0") { hidden1.visible=false; } else { hidden1.visible=true; } if(myXML0.card2=="0") { hidden2.visible=false; } else { hidden2.visible=true; } if(myXML0.card3=="0") { hidden3.visible=false; } else { hidden3.visible=true; } if(myXML0.card4=="0") { hidden4.visible=false; } else { hidden4.visible=true; } txthispoints.text=myXML0.hispoint; allowgame=myXML0.error; if(myXML0.yourmove=="1") { end.visible=true; pass.visible=true; mymove.visible=true; opmove.visible=false; } else { end.visible=false; pass.visible=false; mymove.visible=false; opmove.visible=true; } if(myXML0.pass=="1") { end.visible=false; pass.visible=false; } opponfieldcards = ["","","","","","","","",""]; opponfieldcards = (myXML0.hisfield).split("_"); if (int(opponfieldcards[0])>0 && int(opponfieldcards[0])<11) { standarto0.visible=true; } if (int(opponfieldcards[1])>0 && int(opponfieldcards[1])<11) { standarto1.visible=true; } if (int(opponfieldcards[2])>0 && int(opponfieldcards[2])<11) { standarto2.visible=true; } if (int(opponfieldcards[3])>0 && int(opponfieldcards[3])<11) { standarto3.visible=true; } if (int(opponfieldcards[4])>0 && int(opponfieldcards[4])<11) { standarto4.visible=true; } if (int(opponfieldcards[5])>0 && int(opponfieldcards[5])<11) { standarto5.visible=true; } if (int(opponfieldcards[6])>0 && int(opponfieldcards[6])<11) { standarto6.visible=true; } if (int(opponfieldcards[7])>0 && int(opponfieldcards[7])<11) { standarto7.visible=true; } if (int(opponfieldcards[8])>0 && int(opponfieldcards[8])<11) { standarto8.visible=true; } if (int(opponfieldcards[1])>10 && int(opponfieldcards[1])<21) { cop1.visible=true; } if (int(opponfieldcards[2])>10 && int(opponfieldcards[2])<21) { cop2.visible=true; } if (int(opponfieldcards[3])>10 && int(opponfieldcards[3])<21) { cop3.visible=true; } if (int(opponfieldcards[4])>10 && int(opponfieldcards[4])<21) { cop4.visible=true; } if (int(opponfieldcards[5])>10 && int(opponfieldcards[5])<21) { cop5.visible=true; } if (int(opponfieldcards[6])>10 && int(opponfieldcards[6])<21) { cop6.visible=true; } if (int(opponfieldcards[7])>10 && int(opponfieldcards[7])<21) { cop7.visible=true; } if (int(opponfieldcards[8])>10 && int(opponfieldcards[8])<21) { cop8.visible=true; } for (var i:int = 1; i < 9; i++) { if(int(opponfieldcards[i])>10 && int(opponfieldcards[i])<21) { var myPattern:RegExp = /1/; opponfieldcards[i]=opponfieldcards[i].replace(myPattern, "+"); } } otxt0.text=opponfieldcards[0]; otxt1.text=opponfieldcards[1]; otxt2.text=opponfieldcards[2]; otxt3.text=opponfieldcards[3]; otxt4.text=opponfieldcards[4]; otxt5.text=opponfieldcards[5]; otxt6.text=opponfieldcards[6]; otxt7.text=opponfieldcards[7]; otxt8.text=opponfieldcards[8];}myTimer.start();stop();