TextFieldから文字列がはみ出した時の処理 nium forked:0favorite:1lines:19license : All rights reserved modified : 2008-12-27 03:20:55 Embed Tweet package { import flash.display.Sprite; import flash.text.TextField; public class Main extends Sprite { public function Main() { var tf:TextField = addChild( new TextField() ) as TextField; tf.width = 100; tf.text = "あいうえおかきくけこさしすせそ"; if ( tf.maxScrollH > 0 ) { tf.appendText( "..." ); while ( tf.maxScrollH > 0 ) { var words:Array = tf.text.split( "" ); words.splice( words.length - 4, 1); tf.text = words.join( "" ); } } } } } Code Fullscreen Preview Fullscreen yamat1011 maxScrollH join split appendText width splice addChild text TextField length Array Sprite sort new page view favorite forked pv388 forked from: TextFieldから文字列がはみ.. tabarka forked:1 favorite:0lines:21 (diff:6)