Flasher Archive

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


Subject: RE: FLASH: Random Questions Without Repeating
From: Branden Hall
Date: Wed, 26 Jul 2000 03:31:58 +0100

Actually, snag yourself a copy of the Fast! Editor from SwiffTools.com
THere is a script I put in there just for doing that exact same kind of
thing. You should think about it as shuffling...
Randomly pick two spots in the list and swap them... do that 5X the number
of objects in the list, and it will be pretty random....

-= Branden J. Hall
-= Multimedia Developer / Instructor
-= Fig Leaf Software - "We've got you covered!"


-----Original Message-----
From: owneratchinwag [dot] com [owneratchinwag [dot] com]On">mailto:owneratchinwag [dot] com]On Behalf Of Helen
Triolo
Sent: Tuesday, July 25, 2000 4:55 PM
To: flasheratchinwag [dot] com
Subject: Re: FLASH: Random Questions Without Repeating


It's not as easy in Flash as in Director! Something like the following
should work. I haven't tested it, so there may be typos or something
not syntactically correct, but the theory of it should be OK:

If you have 30 variables, question1 - question30, and you want to
display a random one in textfield <thisquestion>, then do this first
(actually I think Flash defaults a variable to 0 if you don't specify
otherwise, but for the sake of logic I left it in):

Set Variable: "nTimes" = 0 //how many questions have been
displayed

and then this every time you want to show a new question:

Set Variable: "duplicate" = true // just to initialize for
next line
Loop While (duplicate=true) // loop til new random
number found
Set Variable: "ranNum" = random(30)+1 // random number, 1-30
Set Variable: "duplicate" = false // another loop initializer
Set Variable: "checkthis" = 1 // also a loop initializer
(i want flash5 now!)
Loop While (checkthis < nTimes+1 and duplicate=false)
If (ranNum = eval("alreadyasked"&checkthis))
Set Variable: "duplicate" = true
End If
Set Variable: "checkthis" = checkthis+1
End Loop
End Loop
Set Variable: "nTimes" = nTimes + 1
Set Variable: "alreadyasked" &nTimes = ranNum // array of previously
selected numbers (like you suggested)
Set Variable: thisquestion = question&ranNum

---------------------------------------------------
Helen Triolo � http://i-Technica.com � 301-424-6037
Flash Q&A archive � http://i-technica.com/flashlist


Paul Steven wrote:
>
> Hi all
>
> I am making a quiz where there are 30 questions. I want to randomly choose
a
> question and ask it then remove it from the question pool. I normally have
> no problem doing this sort of stuff in Director - I simply create a list
of
> the question numbers and remove the question number from the list after
> asking the question - but I can't figure out how do do it in Flash - am I
> being really dumb?! The only way I can think of is have 30 variables i.e
> Question1_Asked=False, Question2_Asked=False etc and set the boolean to
True
> if asked.
>
> Anyone suggest a better way please.
>

flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 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


flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
July 24-26, 2000, NEW YORK CITY, Hammerstein Ballroom
www.flashforward2000.com
Produced by United Digital Artists and lynda.com
Sponsored by Macromedia, Adobe Systems, Fusion, Inc, AtomFilms,
shockwave.com and Electric Rain.
1.877.4.FLASH.4 or (1.805.640.6679 outside the US and Canada)
Register before June 30 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: Random Questions Without Repe, Helen Triolo

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