Title: Message
Do-while loops are perfectly fine to use. Do-while loops that never end are never a good idea, although the Flash player will time out if ActionScript executes for too long. Your problem is presumably that your criteria are too narrow, so you are looping through scads of random numbers before you find one that is acceptable. Put in a counter and see how many "bad" random numbers you are discarding.
 
If you tell us what you're really tryto do and what your criteria are, maybe we can suggest another way to achieve your goal.
 
- Gordon
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 16, 2005 11:06 AM
To: [email protected]
Subject: [flexcoders] Question about do while loops

Are do while loops useda lot in Flex or are they generally avoided? I know that if you ask the computer to do a do while loop that never ends it will probably slow the computer down. But the loops I have tried to make have been very slow? What I have been trying to do is generate a random number over and over again until it meets a certain criteria.

Reply via email to