Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: using "loop while"
From: Laura Mollett
Date: Tue, 15 Feb 2000 23:57:30 GMT

> Good morning,
> I wonder if someone could explain a few things about the "loop while"
> statement. What kinds of conditions require it, what exactly does it
> do, and how do you choose the number such as loop while n < 1, etc.??
> I just got Flash 4 magic which gives alot of code, but I still wish I
> could find something which would tell me why and for which situations
> I would use certain statements.
> Thanks in advance,
> Karin

Hi Karin,
The "loop while" statement generally loops while a counter is less than a
number. You might set the counter to 0, have the counter increment by +1
each time it goes through the loop, and continue until a specified upper
limit is reached.

In the Flash 4 Magic Matching Game, the first loop makes a name: "smiley" &
a number = "smiley1" - "smiley12" for each of the pieces (and when it gets
to 12 - i.e., all the pieces - it quits). The second loop creates a location
and the 3rd loop (nested) assigns a smiley to that location. The first loop
is while the counter is less than or equal to 12 because that's all the
pieces. The 2nd loop makes spots row by row - so it creates row 1, column 1
to row 1 column 4 so it loops while the counter is less than or equal to 4
(then the nested loop places those tiles) then starts again for the next
row. The 3rd nested loop continues as long as it can find a smiley that
hasn't been placed, then goes back to making locations for the rest. They
both quit when all the spots on the board are taken up.

There are probably other situations, besides counting something, where you
might want to use a loop while, but I can't think of one off the top of my
head.

Hope this helps,
Laura Mollett

flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and The Flash Film Festival
"The World’s Premier Flash Solutions Conference and Expo"
March 27-29, Nob Hill Masonic Center, San Francisco, California

-Register before Feb 25 and save $200!!-- www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  Re: FLASH: using "loop while", Cheri Harder

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]