inicio mail me! sindicaci;ón

t-roy.net*

blog by designer troy ginbey

Array Methods in AS3.0

I’ve been using Array for a while now - but don’t frequently use all of it’s methods… so I’m going to go through the ones I don’t use a lot….

Array.sort();

var beers:Array = ["Fosters", "Alpha", "VB", "Asahi"];
beers.sort(); // default sort
trace(beers); // output: Angelou,Blake,Dante,cummings

beers.sort(Array.CASEINSENSITIVE);
trace(beers); // output: Alpha,asahi,Fosters,VB

beers.sort(Array.DESCENDING);
trace(beers); // output: asahi,VB,Fosters,Alpha

beers.sort(Array.DESCENDING | Array.CASEINSENSITIVE);
trace(beers); // output: VB,Fosters,asahi,Alpha

No comments yet »

Your comment

HTML-Tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>