Skip to main content

Actionscript: Custom Random Function

I made a custom random function in case you are looking for a random number generator in Actionscript. Actionscript has a random number function but it does not really allow you to specify a minimum and maximum range. Here is the code:

private function getRandomNumber(min:int, max:int):int
{
    var xRandomNumber:int;
    xRandomNumber= Math.floor(Math.random() * (max -1)) ) + min; 
   return(xRandomNumber);


} // getRandomNumber


Comments

Popular posts from this blog

LED Monitor Review: LG FLATRON E2041

My Old AOC CRT Monitor began to show signs of dying. It would occasionally black out for a few seconds. Sometimes lightning streaks  would run across the screen. I bought that monitor way back in 2006. It served me well for 5 years. It was very durable and AOC is a good brand. And so I had no choice but to buy myself a new monitor. I would have preferred another CRT Monitor but they were no longer available. Even the more recent LCD screens are being phased out in favor a the newer LED monitors. LG FLATRON E2041 (This was not my first choice but it was the next best thing available in the computer store I visited). 1600 X 900 Resolution (16:9 Aspect Ratio) Contrast Ratio: 5,000,000:1 Brightness: 250 Cd/m2 Dimensions W/Stand (WHD): 17.44" X 13.78" X 6.54" My Feedback This monitor comes with two connectors VGA and DVI. It comes with a CD that is supposed to contain the manual and monitor drivers. However, when you install the monitor driver contain...

GIMP: How to Enable Wacom Pen Tablet

If you are doing digital graphics in Gimp, whether painting or simply drawing, it is best to use a pen tablet. Wacom is a recognized brand when it comes to pen tablets. Gimp does support it but it is not enabled by default. How to Enable Pen Tablet Support 1. Launch Gimp using your pen tablet. Don't use the mouse to launch Gimp. If you do, Gimp won't detect it. 2. In the menu click Edit>Preference. 3. On the list click "Input Devices". 4. Click "Configure Extended Input Decives". Here is where Gimp gets weird. If you started Gimp for the first time using a mouse, it will say there are no available input device. But if you launched it using the pen tablet, you will see "Wacom Tablet Pressure Stylus" and "Wacom Tablet Eraser" . 5. Click the Close Button 6. Click "Save Input Device Settings Now" so that the pen tablet will still be supported when you launch Gimp next time.

The World is Yours

If you were ever a fan of Scarface, the 1983 film starring Al Pacino, you would remember the last scene. Tony was shot on the back by an assassin. He falls down from the balcony into a small pool in the lobby below. He floated face down in the water. Beside him a statue was shown carrying the inscription "The World is Yours". I'm sure most of you find that humorous inspite of the tragic ending. But why did I mention it? Today I was thinking about eCommerce and I can't help but be amazed at the possibilities available to us today. The world is truly ours but only if we got the imagination to seize it. I'm talking about how any individual can be in their pajamas in the comfort of their bedroom and yet be able to sell a product or a service to practically anyone anywhere in the world. All you need really is just a computer and an internet connection and then you are good to go. It is simply amazing especially if you can remember back in the early 1990...