Flash Tutorials, Samples, Resources, Greetings, Games
Home | About Us | Resources | Tutorials | Links | Games | Movies | Projects | Feedback | Contact Us
Tutorials
Here you'll get tutorials for all skill levels wheather you are a new user or an expert flash developer.

» Enter
Resources
In this section you'll get some small movie clips which can be used in your flash projects with flash components, flash action scripts .as files and some other stuff that will help you in your flash projects. You can also submit your work here. For submit details please checkout our Submit Page.

» Enter
Games
Play and download great flash games. If you have any flash game, please send us, we will put it with your name.

» Enter
Movies
Flash FLA movies to download.

» Enter
Home » Resources



   Action Scripts - Array Sort
The following function should be declared for the array sorting purpose. Later we use this function to Sort Array of our own choice

Array.prototype.asort = function()    {
var fnc;
fnc = function(item1,item2)    {
item1 = item1.toUpperCase();
item2 = item2.toUpperCase();
return item1 > item2;
          }
return this.sort(fnc);
          }

Now you can use this function to sort array of your own choice. For this you have to put this script. I have made a sample array for testing. You can place array which you want to Sort.

myarr = new Array("India","China","pakistan","Bhutan","Nepal");
myarr.asort();
trace(myarr)