PDA

View Full Version : Scrolling Numbers


ASG
01-09-2006, 12:39 AM
I am just curious - is there a way to use action script to create a list of randomly generated 0s and 1s that continuously scrolls up the screen.

Or

Just a way to make a list of numbers scroll continuously up the screen.

Thanks

Dylan Marvin
01-10-2006, 07:32 AM
Do need it as actionscript ONLY or can movieclips be involved?

Dylan Marvin
01-10-2006, 07:58 AM
Here's a quick fla for you. The code is in a frame in "myClip", where there is a dynamic text box on one layer, and in another layer the script:
i = Math.round(Math.random());
onEnterFrame=function(){
_y -= 10;
if(_y<=-10){
i = Math.round(Math.random());
_y=310;
}
}

Change the Math.round(Math.random()) in both instances to Math.round(Math.random()*10) for example to have it generate whole numbers between (and including) 0 through 10 or Math.round(Math.random()*9)+1 for whole numbers between (and including) 1 through 10.

ASG
01-10-2006, 09:34 PM
thanks that is exactly what i wanted except is there a way to make it so there is more than 1 number on a line

Dylan Marvin
01-10-2006, 10:17 PM
Just use bigger numbers. Math.round(Math.random()*100000)
Or take everything on the main stage and put it into a movieclip, duplicate that clip a number of times and space them out however you need.