flash on 2009-12-25

by foo9
♥0 | Line 26 | Modified 2009-12-25 20:21:50 | MIT License
play

ActionScript3 source code

/**
 * Copyright foo9 ( http://wonderfl.net/user/foo9 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/aZzV
 */

package 
{
    import flash.display.Sprite;
    import flash.text.Font;
    import flash.text.TextField;

    public class FlashTest extends Sprite
    {
    		private var _txtfield:TextField;
    		private var _allFontList:Array
    	
        public function FlashTest() 
        {
            // 使用できるフォント一覧
			_allFontList = Font.enumerateFonts(true);
			_allFontList.sortOn("fontName", Array.CASEINSENSITIVE);
			
			_txtfield = new TextField();
			addChild(_txtfield);
			_txtfield.width = 400;
			_txtfield.height = 400;
			_txtfield.background = true;
			_txtfield.backgroundColor = 0xCCCCCC;
			for each(var t:Font in _allFontList)
			{
				_txtfield.text += t.fontName + "\n";
			}
        }
    }
}