flash on 2010-4-8

by lewis_c1986
♥0 | Line 26 | Modified 2010-04-08 23:46:48 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.system.*;
    import flash.text.*;
    import flash.ui.*;
    public class FlashTest extends Sprite {

		private var systemFonts:Array = new Array(); //Will store all the system fonts  
		private var fontNames:Array = new Array(); //Will store all the system fonts as Strings  
		private var fmt:TextFormat = new TextFormat(); //Textformat of the TextInput  
		//private var combo:
		private var tf:TextField = new TextField();
		
		public function FlashTest() {
            // write as3 code here...
            
            tf.multiline = true;
            tf.defaultTextFormat = fmt;
            tf.text = "Hello"
        }
        private function loadFonts():void  
		{  
			systemFonts = Font.enumerateFonts(true); //Returna an array of the installed fonts  
			systemFonts.sortOn("fontName"); //Sorts the font by name  
			/* Convert the Fonts Objects to Strings */  
			for (var i:int = 0; i < systemFonts.length; i++)  
			{  
				fontNames.push(systemFonts[i].fontName);  
			}

			/* Set List data */  
			//fontsMenu.fontsList.dataProvider = new DataProvider(fontNames);
		} 
    }
}