flash on 2010-11-5

by BMA_JAPAN
♥0 | Line 40 | Modified 2010-11-05 11:27:32 | MIT License
play

ActionScript3 source code

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

package {
    import flash.text.TextField;
    import flash.display.Sprite;
    import flash.text.TextFormat;
    import jp.progression.commands.*;
    import jp.progression.commands.lists.SerialList;
    import jp.progression.commands.lists.*;
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var list:SerialList = new SerialList();
            var j:int;
            var hoge:int;
            var format = new TextFormat();
            format.size =24;        // 文字のポイントサイズ
            format.color = 0xFF0000;    // 文字の色
            var text1:TextField = new TextField();
            text1.multiline = true;
            text1.defaultTextFormat = format;
            text1.height = 512;
            text1.width = 512;
            addChild(text1);
            for(var i:int=0;i<5;i++){
                list.addCommand(
                            new Var("i",hoge),
                            new Var("i",i),
                            function():void{
                                j = j + i;
                                text1.text += "i="+i+" getVar="+this.getVar("i")+"\n";
                                trace("i="+i, "getVar="+this.getVar("i"));
                                trace(i);
                                //this.setVar("j",j);
                                this.setVar("i",hoge);
                            },
                            new Trace(hoge)
                    )
            }
            list.execute();
            //trace(i);
            text1.text += "hoge:"+hoge;
        }
    }
}