just musing -- actionscript "deprecated" functions

This isn't really a very serious question; I'm just curious for other opinions.

I see that Flash is finally dropping something in 8 ("add") which was deprecated back in v5...

(see http://www.powersdk.com/ted/2005/08/flash-8-deprecated-gets-teeth.php)

So here's the thing: when it comes to random numbers, I find "random(n)" MUCH simpler to use than "Math.floor(Math.random() *n)". I know that "random(n)" isn't really random, but I also don't really care; it's close enough.

Am I just being lazy, or does anyone else feel the same way? Will they drop the hammer on us and actually eliminate "random(n)" anytime soon? Someone whip up a quick little Magic 8 Ball thing to tell us the answer...
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MontoyaProcess Improvement MgrCommented:
Well, when creating an application that is going to select a "random" value, you actually want it to select a random value. Otherwise, what is the point? The use of random (n) by itself would, as you know, generate some randomness in the numbers, but certain numbers would always come up more often than others. Therefore, they came up with the Math.random with the floor and ceiling. Now, the funny thing that I've never understood... Why didnt they just fix random(n) to actually work? Why create a new command (sort of) and make it so complicated to generate a random number? That's never made sense to me. It seems so much more logical and simple to use random(0,15) to get a random number between 1 and 15.

All that said, you could write your own .as and create a similar function. Then, reuse the function as you would a snippet. So, I would create a function called Randomize() that accepts two variables (min, max).


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
amateur6Author Commented:
Good point!!

I was just reading over at O'Reilly that "For many designers, the ActionScript 2.0 OOP coding style may initially seem a little long-winded because more lines of code seem to be concerned with building up the code structure than actually solving the problem at hand, especially for modest classes. This extra structure is, however, a real advantage in the long term."

I just wish they wouldn't throw the baby out with the bath water. If I wanted a real programing language, I'd be a code monkey. As it is, I'm a designer who wants to play around with coding stuff; don't start taking AWAY what little understanding I have!

amateur6Author Commented:
Points to you, Montoya -- guess no one else wants to weigh in. Thanks tho!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.