/**
* Copyright vianty ( http://wonderfl.net/user/vianty )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/7dgS
*/
package {
import flash.events.Event;
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.display.JointStyle;
import flash.display.CapsStyle;
import flash.display.LineScaleMode;
public class FlashTest extends MovieClip {
public function FlashTest() {
// write as3 code here..
var obj2:MovieClip = new MovieClip();
obj2.na
obj2.graphics.lineStyle(5, 0x030599, 1, true, LineScaleMode.NORMAL, CapsStyle.ROUND, JointStyle.ROUND);
obj2.graphics.drawRect(5, 0, 150,100);
obj2.graphics.lineStyle(2, 0x030599, 1, false, LineScaleMode.NORMAL, CapsStyle.ROUND, JointStyle.ROUND);
//obj2.graphics.drawRect(11, 6, 139, 89);
obj2.graphics.beginFill(0x030599);
obj2.graphics.drawRect(11,6,139,89);
obj2.graphics.endFill();
//yg bisa ter drag drop adalah yg ada warnanya aja, kotak antar biru yg putih g bisa di drag.
obj2.x=obj2.y=10;
obj2.addEventListener(MouseEvent.ROLL_OVER, rollOver);
obj2.addEventListener(MouseEvent.MOUSE_DOWN, drag);
this.addEventListener(MouseEvent.MOUSE_UP, drop);
addChild(obj2);
}
public function rollOver(e:Event):void{
e.target.buttonMode = true;
e.target.useHandCursor = true; //kursornya berubah if buttonMode nya juga di true kan
}
public function drag(e:MouseEvent):void{
e.target.startDrag();
}
public function drop(e:MouseEvent):void{
stopDrag();
}
}
}