I’m trying to make a kids score board where there are 20 icons all with scores behind them between 1 and 20 and a kid chooses an icon, clicks on it to reveal their score, thenthe score is added to their teams running total at the bottom of the window. (There are 2 teams)
The thing i have a problem with is generating the random numbers and also where exactly to drop in the actionscript in the timeline.
I’ve tried different variations of the Math.Floor(Math.Random) but i cant seem to get it to produce the numbers i want!!!
Unfortunatly i cant upload what i have been working on as i dont have net access on my work pc.
Thanks for the speedy response! I will try it out as soon as I get back.(-:
I dont suppose you would know how i could get it to keep 2 seperate totals at the bottom of the screen do you? 1 total each for Team A and Team B - they would take it in turns to reveal a score and that score would be added to the total for their team.
Hi,
a bit confused about your heading for the problem, but then
this what i have for you , if i’m correct.
This function returns a random number, with given limit.
//----------------------------------------------------------------
// getRangeInclusive
//
// Returns a random number secified within the range including extrem values
// Usage : var myVar = getRangeInclusive(lowerLimit, higherLimit) ;
//
function getRangeInclusive(iMin, iMax) {
var iDiff = iMax-iMin+1;
var v1 = Math.floor(Math.random()*iDiff)+iMin;
return (v1);
}
//----------------------------------------------------------------
Thanks for the response. I can’t get these scripts to work. I’m attaching them to the point in the timeline but i just seem to be not doing something right. When i publish the file to test it it usually comes up with something along the lines of “level2_” instead of the random number between 1 and 20.
Any ideas?
Peter
(Sorry i’m unable to upload the file - if someone would be kind enough to post a sample for me to look at i would be ever greatfull - Thanks!)