flash on 2010-10-20

by tepe
♥0 | Line 22 | Modified 2010-10-27 15:00:56 | MIT License
play

ActionScript3 source code

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

package {
    import flash.events.*;
    import flash.display.AVM1Movie;AVM1Movie
    import flash.display.Sprite;
    import flash.net.FileReference;    
    public class FlashTest extends Sprite {
        private var s:Sprite;
        public function FlashTest() {
            s = new Sprite();
            s.graphics.lineStyle(1,0x000000);
            s.graphics.beginFill(0x00ff00,1);
            s.graphics.drawRect(50,50,50,50);
            s.graphics.endFill();
            addChild(s);
            s.addEventListener(MouseEvent.CLICK,clickTxtBtn);
            
        } 
              
        private function clickTxtBtn(event:MouseEvent):void{  
                  
            var fileRef:FileReference = new FileReference();  
            fileRef.save( "test ssss", "text.txt" );
            //fileRef.load
        } 
    }
}