??の代わり?

by esukei
♥8 | Line 22 | Modified 2009-10-15 12:32:25 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.text.TextField;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var textField:TextField = new TextField();
            textField.width = stage.stageWidth;
            textField.height = stage.stageHeight;
            textField.text = '';
            textField.multiline = true;
            textField.wordWrap = true;
            addChild(textField);
            
            textField.appendText( hoge() );
            textField.appendText('\n');
            textField.appendText( hoge('nullじゃないよ') );
            
        }
        
        private function hoge(a:String = null):String
        {
            return a || 'nullだよ';
        }
    }
}