forked from: flash on 2010-3-23

by omari forked from flash on 2010-3-23 (diff: 6)
♥0 | Line 58 | Modified 2011-01-30 21:41:26 | MIT License
play

ActionScript3 source code

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

// forked from hacker_9p8x8mco's flash on 2010-3-23
package {
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    public class FlashTest extends Sprite {
            public var gomokuform:GomokuForm;
        public function FlashTest() {
            // write as3 code here..
            this.gomokuform = new GomokuForm();
            addChild(this.gomokuform);
        }
    }
}


import flash.display.Graphics;
import flash.display.Sprite;
import flash.text.TextField;
    
class GomokuForm extends Sprite{
    public var tf_desc:TextField;
    public var squares:Array = new Array();
    
    public function GomokuForm(){
        this.createBoard();        
    }
    public function createBoard():void{
        this.tf_desc = new TextField;
        this.tf_desc.text = "GommokuFormu";
        this.addChild(this.tf_desc);
        var x:int;y:int;
        for(y = 0;y < 5; y++){
            var ar:Array = new Array;
            this.squares.push(ar);
            for(x = 0; x < 10; x++){
                var sq:Square = new Square();
                ar.push(sq);
                this.addChild(sq);
                sq.x = x * 30;
                sq.y = y * 30 + 20;
                sq.xpos = x;
                sq.ypos = y;        
            }
        }    
    }
}

import flash.display.Graphics;
import flash.display.Shape;
import flash.display.Sprite;
import flash.display.GradientType;
import flash.geom.Matrix;
class Square extends Sprite{
    public var xpos:int;
    public var ypos:int;
    public var status:String = "BLANK";

    public function Square(){
        var g:Graphics = this.graphics;
        g.beginFill(0xFF9900);
        g.lineStyle(1,0);
        g.drawRect(0,0,150,150);
        g.endFill();
    }
}