You must do it in a way that you call function (for example in function would be similar code block as in your for loop) you need in OnEnterFrame, and remember function state in static and/or global variables.
"Morrisy Van" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders