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

if(false)の中は自由?

なぜかwhile(false)はダメでした。
Get Adobe Flash player
by shohei909 22 Jan 2011
/**
 * Copyright shohei909 ( http://wonderfl.net/user/shohei909 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/9efW
 */

// forked from Nicolas's switch文のbreakの外は自由?
package {
    import flash.text.TextField;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            if( false ){
                ここも自由
            }
            if( true ){}else{
                こっちだって自由
            }
            if(false)の中は自由
            
            while( false ){
                //こっちはだめ
            }
            var tf:TextField = new TextField();
            addChild(tf);
            tf.text = "No Error!!";
            return;
            こんなところも使える
        }
    }
}