Click Object and Move

by radiohabitat
This was just a test to create a object on stage and move the object, with a transparency object added 
♥0 | Line 27 | Modified 2011-05-06 09:29:09 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.text.TextField;
  
    
    
    [SWF (backgroundColor="#000000")]
    public class shapeTransition extends Sprite {
        public function shapeTransition() {
            
            var box:Sprite = new Sprite ();
            var info_txt:TextField = new TextField ();
            
            
          
               
                box.graphics.beginFill(0x3dc3dc);
                box.graphics.drawRect(30, 100, 300, 100);
                box.graphics.endFill();
                addChild(box);
                
                box.buttonMode = true;
                box.addEventListener(MouseEvent.MOUSE_DOWN, moveBox);
                box.addEventListener(MouseEvent.MOUSE_UP, stopBox);
                
                function moveBox(event:MouseEvent):void {
                    startDrag();
                    box.alpha=.5;
                   
                    
                 
                }
                
                function stopBox (event:MouseEvent):void {
                    stopDrag();
                    box.alpha=1;
                    
                    
                }

                
              
                
            }

            
            
         
            
        }
    
}