Flash: A better sortOn() function
The Array.sortOn() function in ActionScript 2 and ActionScript 3 has a bug in it that causes you to be unable to use it to sort on Object properties that use a Getter function rather than a native property. So, for instance if the property you want to sort on is something like this...
public function get sortValue()
{
return someNumber;
}
...and you want to call sortOn like this...
someArray.sortOn("sortValue");
...it won't sort correctly. From what I can tell, it seems to sort okay as long as the numbers returned by the getter function are under ten. After that, it will sort by the first digit of the number, so 1 == 10 == 11 == 12 == 13 etc. Anyway, getting around this isn't too hard, you just have to make your own sortOn prototype, like this:
Array.prototype.sortOnNumber = function(sortOn:String) {
var index:Object;
var j:Number;
for (var i:Number=1;i<this.length;i++)
{
index = this[i];
j = i;
while ((j > 0) && (Number(this[j-1][sortOn]) > Number(index[sortOn])))
{
this[j] = this[j-1];
j = j - 1;
}
this[j] = index;
}
}
Type casting the comparison objects to Number() seems to solve the problem. This particular sort function uses an insertion sort algorithm. Implementing other algorithms is up to you.
References
http://board.flashkit.com/board/showthread.php?t=740083
http://linux.wku.edu/~lamonml/algor/sort/insertion.html

SOAP Client for OSX
Developing Native iOS Apps with the Force.com Mobile SDK
Application Development with Android
Moving the Cloud - HTML5 and CSS3 on Node.js
Private Cloudwashing — No Innovation? Duh…
Painless Mobile App Development Webinar
Fluid Mobile HTML5 Design and Development
Codesign: Re-Signing an IPA between Apple accounts
Developer’s First Look at Windows 8 Metro
Storing Data Offline with Salesforce Mobile SDK SmartStore
Using XMLHttpRequest2 in iOS 5 or Android OS 3 to download binary files using HTML5/Phonegap
oAuth 2.0 for Salesforce.com
Setting Up and Using DiffDog for Salesforce.com Deployment Validation
The day the cloud stood still. Lessons learned roundup…
It’s Not Broken. You’re Just Doing It Wrong.
iOS Enterprise MDM Configuration Capabilities
Some Thoughts on Gamification
Cloud to Cloud: Using AWS Simple Email Service from Force.com
Importing a Flex 3 AIR project into Flash Builder 4
OSX Firefox Flex/Flash redraw bug workaround
Setting up automated testing in Flex SDK 3.3.0
Force.com Flex Toolkit AIRConnection updates
Clang! Powerful Memory Profiling for the iPhone
iPhone Programming: Adding a Contact to the iPhone Address Book
Lessons for the Beginning iPhone Developer
Installing a Whole-House Powered Humidifier without a Sail Switch
Eclipse IDE Irritations
Review: Zoom H4 Digital Audio Recorder
Android: Custom Spinners
Android: Custom Buttons
Android: Common Tasks
MP3 Encoding, 16 bit , 24 bit, or 32 bit?
Flash: A better sortOn() function
Rendering Isometric Tiles in Blender 3D
PHP: Replace "Smart Quotes" and other high-bit characters
Actionscript 3: Extra Timer Callback Parameters
OSC between Max/MSP and SC3
SC3: Flash and OSC
SC3 Tank Reverb (JMC)
Search SC3 Code Script
JPEG to WAV Converter
SC3 808 Kick Drum
SC3 Markov Chain
SC3 Pulse Train
Roland XP-80 Device XML for Cubase SX3










Excellent posts to read keep it up and keep going on this way. And keep sharing these types of things Thanks
Thanks for this post! I've been working on a render script for isometric game resources in blender and when I started working on tiles I could tell something was not quite right. Comparing your tiles and blend files to my script I was able to quickly find and resolve my issue.