ja som to zaradil do zlej témy .... je to actionScript , problem je v tom ze som tam dal switch a do neho true ,
ono to bere len prvu podmienku z case , skusil som to dat aj do zatvoriek ale aj tak
Kód:
function timeToSec():Number
{
return my_date.getHours() * 60 + my_date.getMinutes();
}
switch (true)
{
case timeToSec()>=345 && timeToSec()<= 405: myText.text += "5:45\n";
case timeToSec()>=376 && timeToSec()<= 436: myText.text += "6:16\n";
case timeToSec()>=409 && timeToSec()<= 469: myText.text += "6:49\n";
case timeToSec()>=416 && timeToSec()<= 476: myText.text += "6:56\n";
case timeToSec()>=425 && timeToSec()<= 485: myText.text += "7:05\n";
case timeToSec()>=465 && timeToSec()<= 525: myText.text += "7:45\n";
case timeToSec()>=511 && timeToSec()<= 571: myText.text += "8:31\n";
case timeToSec()>=529 && timeToSec()<= 589: myText.text += "8:49\n";
case timeToSec()>=545 && timeToSec()<= 605: myText.text += "9:05\n";
case timeToSec()>=649 && timeToSec()<= 709: myText.text += "10:49\n";
case timeToSec()>=656 && timeToSec()<= 716: myText.text += "10:56\n";
case timeToSec()>=665 && timeToSec()<= 725: myText.text += "11:05\n";
case timeToSec()>=769 && timeToSec()<= 829: myText.text += "12:49\n";
case timeToSec()>=776 && timeToSec()<= 836: myText.text += "12:56\n";
case timeToSec()>=785 && timeToSec()<= 845: myText.text += "13:05\n";
case timeToSec()>=836 && timeToSec()<= 896: myText.text += "13:56\n";
case timeToSec()>=889 && timeToSec()<= 949: myText.text += "14:49\n";
case timeToSec()>=896 && timeToSec()<= 956: myText.text += "14:56\n";
case timeToSec()>=905 && timeToSec()<= 965: myText.text += "15:05\n";
case timeToSec()>=945 && timeToSec()<= 1005: myText.text += "15:45\n";
case timeToSec()>=982 && timeToSec()<= 1042: myText.text += "16:22\n";
case timeToSec()>=1009 && timeToSec()<= 1069: myText.text += "16:49\n";
case timeToSec()>=1016 && timeToSec()<= 1076: myText.text += "16:56\n";
case timeToSec()>=1025 && timeToSec()<= 1085: myText.text += "17:05\n";
case timeToSec()>=1129 && timeToSec()<= 1189: myText.text += "18:49\n";
case timeToSec()>=1136 && timeToSec()<= 1196: myText.text += "18:56\n";
case timeToSec()>=1145 && timeToSec()<= 1205: myText.text += "19:05\n";
case (timeToSec()>=1249 && timeToSec()<= 1309): myText.text += "20:49\n"; //podmienka je v zatvorkach aj tak vezme len prvu
case timeToSec()>=1265 && timeToSec()<= 1325: myText.text += "21:05\n";
case timeToSec()>=1270 && timeToSec()<= 1330: myText.text += "21:10\n";break;
break;
default : myText.text += "Nejdu vlaky "+ timeToSec();break;
}