Share Posted September 1, 2011 Hey everyone, I'm wondering if anyone's ever run across a class or component that will create an effect while a total is being calculated....I have to make a server call to get a value and while that's happening, I want to display a string of random numbers of a set length until the value comes back. I googled and didn't come up with anything and figured I'd ask before rolling up my own. Thanks! Link to comment Share on other sites More sharing options...
Share Posted September 1, 2011 to display a string of random numbers of a set length function randomNumber(min:Number, max:Number):Number { return Math.floor(Math.random() * (1 + max - min) + min); } trace(randomNumber(1000, 9999)); the above will give you a random 4 digit number. adjust the min/max as needed. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now