forked from: 日本語sort test
...
@author narutohyper
/**
* Copyright narutohyper ( http://wonderfl.net/user/narutohyper )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/oOMn
*/
// forked from meemeer's 日本語sort test
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.text.TextField;
/**
* ...
* @author narutohyper
*/
public class Main extends Sprite
{
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
var list:Array = [
{ name:'荒木飛呂彦', yomi:'あらきひろひこ' },
{ name:'小畑健', yomi:'おばたけん' },
{ name:'豪血寺一族', yomi:'ごうけつじいちぞく' },
{ name:'魔夜峰雄', yomi:'まやみねお' },
{ name:'篠原千絵', yomi:'しのはらちえ' },
{ name:'天野月子', yomi:'あまのつきよ' }
];
list=list.sortOn('yomi');
var tf:TextField = new TextField();
addChild(tf);
for (var i:int = 0; i < list.length; i++)
{
tf.appendText(list[i].name+"\n");
}
}
}
}