forked from: Text Change forked from: flash on 2010-4-13

by hacker_johiroshi forked from MessageBox (diff: 54)
♥0 | Line 34 | Modified 2010-05-22 21:48:21 | MIT License
play

ActionScript3 source code

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

// forked from kihon's flash on 2010-4-13
package
{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.display.SimpleButton;
	import flash.events.MouseEvent;
 
public class Message extends Sprite
	{
		private var tf:TextField;
		private var count:int = 0;
		private var message:Array = ["私は", "樋口", "くんである"];
 
 		public function Message()
		{
			var tf:TextField = createTextField(30, 30, 400, 400);
 			tf = new TextField();
			tf.defaultTextFormat = new TextFormat("", 20, 0x0, true);
			tf.text = "Hello?"
			tf.autoSize = "left";			
			addChild(tf);
		}

			//textBoxの作成
		private function createTextField(x:Number, y:Number, width:Number, height:Number):TextField {
		
            	var result:TextField = new TextField();
            	result.x = x;
            	result.y = y;
            	result.width = width;
            	result.height = height;
            	result.border = true;
            	result.background = false;
            	addChild(result);
            	return result;
        		}
	}
}