Posts tagged ‘tip’

Simple way to randomise Arrays in AS3

Leave a commentApril 21 | 2009

Found this over at daveoncode and thought i would like to share it:

1
2
3
4
5
6
7
8
9
10
private function _getRandom(arr:Array):void

    var arr2:Array = new Array();

    while (arr.length > 0) {
        arr2.push(arr.splice(Math.round(Math.random() * (arr.length - 1)), 1)[0]);
    }

    return arr2;
}

Say goodbye to spaceball.gif

Leave a commentMarch 30 | 2009
taken by eclecticlibrarian

taken by eclecticlibrarian

http://addons.hback.net/

Here’s a handy add-on for FireFox that bypasses the spaceball.gif so you can easily link to or download your favourite images. I’m not suggesting that you rip off anyone on the site, but it’s great for when you need to easily embed a photo from flickr and link back to the site.