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

switch文のbreakの外は自由?

Get Adobe Flash player
by Nicolas 21 Jan 2011
/**
 * Copyright Nicolas ( http://wonderfl.net/user/Nicolas )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/pIB4
 */

package {
    import flash.text.TextField;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            var rnd:Number = 5 * Math.random();
            var n:int = Math.round(rnd);
            switch(n) {
                //最初のcaseの上はだめらしい。
                case 0:
                break;
                aaaaaaaaaaaaaaaaaaaaaaaaaaaa
                case 1:
                break;
                hogehogehogehoge
                case 2:
                break;
                switch文のbreakの外は自由・・・
                case 3:
                break;
                変数に使える文字なら怒られないような気がする
                case 4:
                break;
                句読点や三点リーダは怒られました
                複数行でも大丈夫だ問題ない
            }
            var tf:TextField = new TextField();
            addChild(tf);
            tf.text = "No Error!!";

        }
    }
}