# (FMX) Trying to create a lotto draw

**URL:** <https://forum.kirupa.com/t/fmx-trying-to-create-a-lotto-draw/47389>\
**Category:** flash\
**Created:** [April 3, 2004, 4:59am UTC](https://forum.kirupa.com/t/fmx-trying-to-create-a-lotto-draw/47389 "2004-04-03T04:59:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![daboz](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@daboz](https://forum.kirupa.com/u/daboz)\
**Post date:** [April 3, 2004, 4:59am UTC](https://forum.kirupa.com/t/fmx-trying-to-create-a-lotto-draw/47389/1 "2004-04-03T04:59:18Z")

</div>

I have recently had the idea to create a lottery draw, the code below will create 7 randomly selected numbers and place these in the output window.  
My problem is how to use the 7 random numbers to display the corresponding lottoball on the stage.  
Should I create a movie for each lootoball or place all the lottoballs in 1 movie on seperate frames and have code goto each frame? I dont know!

If anyone could help I would be most appreciative.

pickfrom = new Array();  
winlist = new Array();  
all = 49;//49 lottoballs the choose from  
shown = 7;//show 7 winners  
for (i=0; i\<all; i++) {  
pickfrom\* = i+1;  
}  
trace("  
Begin:"+pickfrom);  
for (i=0; i\<shown; i++) {  
rand = Math.floor(Math.random()_(all-i));  
winlist_ = pickfrom[rand];  
pickfrom.splice(rand, 1);  
}  
trace("Rest: “+pickfrom+”  
Show Winner: "+winlist);
