Flash Random
- Started
- Last post
- 11 Responses
- irrelevant
How do I create a random number in flash 1-20 without repeats when a user clicks 20 times?
thanks
- kinetic0
Math.randomNumbers = function(numberNeeded, chooseFrom) {
numFrom = chooseFrom;
ranNumbers = new Array();
for (i=0; i
- kinetic0
oops
check this then, 2nd post:
http://forums.ultrashock.com/ff.…
- Mimio0
randomNum = Math.floor(Math.random() * myMax);
myMax = the ceiling number
Then build a array from the result. Store the myMax number as it's used. Then scan this array the next time you call the random function so as to not repeat it.
- Mimio0
Even better kinetic.
- stewart0
maybe it's more of the same like posted above but read this:
- irrelevant0
wow thanks.. although you guys talk to me like I know about Arrays and math.random.
I come from the old school of Flash before there was actionscript.
If any of you guys have a second I have a flash file you can look at to show you what I am trying to do.
http://www.tomatocreative.com/ra…
thanks,
Chris
- stewart0
mx2004 here, sorry.
what about posting your actionscript here?
http://pastebin.coconut.se/
- irrelevant0
Stewart.. I don't have any actionscript to post.. here is the mx file
If you could help me out me out I would greatly appreciate it..thanks
- st33d0
http://proto.layer51.com/d.aspx?…
this one is a pretty good function.
Tip: gotoAndStop(), look it up.
Tip2: use MCs not Buttons. You can use code in MCs, makes life easier when I have to clean up your mess.
I've sort of implemented what you want. But I've given some of the variables obscene names, so you're going to have to learn whats going on if you don't want things called goatFucker and such.
http://www.robotacid.com/misc/ra…
;)
- irrelevant0
steed.. you rock my man.
I will keep the labels the same just to piss my boss off.
I'm always looking for some actionscrip help. Would you be interested in some contract work from time to time?
If so drop me a line.
thanks,
Chris
- st33d0
If it's as easy as as that question, sure. I'm seven shades of no job and trying to build an XML / AS2.0 interface. My moniker has contact details.
You should bookmark actionscript.org though. The forum is really busy (instant replies) and they've solved every impossible problem I've brought to them.
rock on.