In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

改行のバグ?

改行コードの位置と表示の位置がおかしくない?
appendText()で改行コード入れるとおかしいかも
うちの環境では、\rも改行されずに表示されてる
Get Adobe Flash player
by sakusan393 21 Dec 2010
  • Related works: 1
  • Talk

    9re at 21 Dec 2010 09:21
    うん。エディタ作ってるときに困りましたね・・・ http://wonderfl.net/c/vMPA
    Embed
/**
 * Copyright sakusan393 ( http://wonderfl.net/user/sakusan393 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/woh3
 */

package {
    import flash.text.TextFormat;
    import flash.text.TextField;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            
            var tf:TextField = new TextField();
            var tfm:TextFormat = new TextFormat("_ゴシック", 30);
            tf.defaultTextFormat = tfm;
            tf.border = true;
            tf.width = tf.height = 400;
            addChild(tf);
            tf.x = tf.y = 32;
            
            var str:String = "ほげ\rもじゃ\nぶらふ";

            tf.appendText( str );
            tf.appendText( "\n=====\n" );
            
            tf.text += "\n-----\n";            
            tf.text += str;
            tf.text += "\n=====\n";
        }
    }
}