Thursday, October 16, 2008

Flash ActionScript - Randomize an array in 1 easy line of code!

An easy "shuffle" or "randomizer" for a Flash array. Only 1 line of code.
yourArrayName.sort(function(a,b){return random(3)-1;});
Tatum

About the author | Tatum Hindman

Tatum is the president of TBH Creative and is responsible for building long-term client relationships. She enjoys the strategy behind web design and sitting down with clients to define online marketing goals. She likes to blog about questions or topics that clients ask about as well as sharing new tricks.

View more posts by Tatum
 

Subscribe to this blog