|
|
|||||
Регистрация: Dec 2006
Сообщений: 11
|
цикл
Ребята, подскажите, ламеру.
Надо циклически просматривать фотки. Без цикла все работает. В цикле программа зависает. Подскажите что не так. |
|
|||||
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
Ага. И когда, по-твоему, твой вайл прекратится? Точно - НИКОГДА.
Когда выполняется цикл, все почтительно курят в сторонке,и никакая j у тебя не изменится.
__________________
Reality.getBounds(this); |
|
|||||
...
модератор форума
Регистрация: Sep 2006
Адрес: Minsk
Сообщений: 4,286
|
зачем тебе сдесь нужен цикл??? Код, который написан в цикле, будет выполняться до тех пор, пока услове истинно. Т.е. условия в стиле j<=1, без счетчика в нутри цикла j++ или что то типа того, тут не уместны. У тебя получается что твой код должен выполниться бесконечное количество раз, поэтому и виснет.
Зачем setInterval писать в цикле? |
|
|||||
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
2 udaaff - это попытка сделать бесконечный переключатель - цикл запускается, альфа падает - упала - цикл обрывается и запускается снова.
Просто счетчик j, поставленный вне тела цикла, само собой, не работает ---------------- UPD на самом деле фиг знает, для чего всё это. Не пойму логику Запускающиеся пачкой интервалы - может это вирус?
__________________
Reality.getBounds(this); Последний раз редактировалось Wolsh; 11.08.2007 в 18:39. |
|
|||||
var theEarthIsTurning:Boolean = true; var Things:Array = new Array("Wheeeeee","I can fly","I do believe in faries","It ain't gonna stop spinning","Stop? - not gonna happen","Turny turny turny turny","Teee-heee","I know you're loving it"); while(theEarthIsTurning){ trace("[Please mind the gap] "+Things[(Things.length-1)*Math.random()]+"!"); } _root.redButton.on(press){ tryToStopTheEarth(); } tryToStopTheEarth = new function():void{ trace("Tonight Im gonna have myself a real good time I feel alive and the world turning inside out yeah! And floating around in ecstasy So dont stop me now dont stop me cause Im having a good time having a good time Im a shooting star leaping through the sky Like a tiger defying the laws of gravity Im a racing car passing by like lady godiva Im gonna go go go Theres no stopping me Im burning through the sky yeah! Two hundred degrees Thats why they call me mister fahrenheit Im travling at the speed of light I wanna make a supersonic man out of you Dont stop me now Im having such a good time Im having a ball dont stop me now If you wanna have a good time just give me a call Dont stop me now (cause Im havin a good time) Dont stop me now (yes Im havin a good time) I dont want to stop at all Im a rocket ship on my way to mars On a collision course I am a satellite Im out of control I am a sex machine ready to reload Like an atom bomb about to Oh oh oh oh oh explode Im burning through the sky yeah! Two hundred degrees Thats why they call me mister fahrenheit Im travling at the speed of light I wanna make a supersonic woman of you Dont stop me dont stop me Dont stop me hey hey hey! Dont stop me dont stop me ooh ooh ooh (I like it) Dont stop me dont stop me Have a good time good time Dont stop me dont stop me ah Im burning through the sky yeah! Two hundred degrees Thats why they call me mister fahrenheit Im travling at the speed of light I wanna make a supersonic man out of you Dont stop me now Im having such a good time Im having a ball dont stop me now If you wanna have a good time just give me a call Dont stop me now (cause Im havin a good time) Dont stop me now (yes Im havin a good time) I dont want to stop at all"); }
__________________
I'm only happy when it rains. Waka Laka |
Часовой пояс GMT +4, время: 17:40. |
|
« Предыдущая тема | Следующая тема » |
|
|