静岡理工科大学 | 菅沼ホーム | ActionScript 目次 | 索引 |
package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFieldType; import flash.text.TextFormat; import flash.text.TextFormatAlign; [SWF(backgroundColor="0xeeffee", width="300", height="200", frameRate="30")] public class TextField_e extends Sprite { public function TextField_e() { init(); } private function init():void { var msg : TextField = new TextField(); msg.text = "何か入力して!"; msg.width = 150; msg.height = 25; msg.x = 75; msg.y = 25; msg.type = TextFieldType.DYNAMIC; var tf_msg : TextFormat = new TextFormat(); tf_msg.size = 20; tf_msg.align = TextFormatAlign.CENTER; msg.setTextFormat(tf_msg); addChild(msg); var tx : TextField = new TextField(); tx.width = 250; tx.height = 100; tx.x = 25; tx.y = 75; tx.type = TextFieldType.INPUT; tx.background = true; tx.backgroundColor = 0xffffff; tx.border = true; tx.borderColor = 0x00ff00; tx.multiline = true; var tf : TextFormat = new TextFormat(); tf.size = 30; tx.defaultTextFormat = tf; addChild(tx); } } }
静岡理工科大学 | 菅沼ホーム | ActionScript 目次 | 索引 |