How about using the break keyword?

*******************************
package {
import flash.display.Sprite;
import flash.util.trace;

public class LoopTest extends Sprite {

public function LoopTest() {
var i:uint = 0;
for(;;) {
i++;
if (i > 20) {
break;
}
}
trace("Loop exited.");
}

}
}
*********************************



On 10/26/05, Morrisy Van <[EMAIL PROTECTED]> wrote:
>
>
> hi list,
>
> been doing some flex2 AS3 socket programming recently,
> just wondering could i use some code like this (as we
> do in java):
>
> [code]
> String line;
> for(;;) {
> line = in.readLine( );
> if (line == null) throw new IOException("Unexpected
> EOF");
> if (line.equals(".")) break;
> msgs.add(line);
> }
> [/code]
>
> or
> [code]
> while(true){
> //do some socket operation....
> }
> [/code]
>
> whenever I ran code like this, flash player went into
> infinite loop and crashes.
>
> so is there any way to wait until the socket finishes
> it's job and the code went on ?
>
> btw, I know there are onSocketData and onProgress for
> socket, but by using them i would have to split my
> code into chunks and it's gonna be hard to maintain.
>
> thanks.
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
> _______________________________________________
> Flashcoders mailing list
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>



--
--------------------------------------------
Stephen Milligan
Do you do the Badger?
http://www.yellowbadger.com

Do you cfeclipse? http://www.cfeclipse.org
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to