--年--月--日 --:--
新しい記事を書く事で広告が消せます。
--年--月--日 --:--
2008年07月26日 11:04
box1.buttonMode = true;//MCをボタンMCのようにカーソルを変えます。
box1.addEventListener(MouseEvent.MOUSE_DOWN, boxStartDrag);
box1.addEventListener(MouseEvent.MOUSE_UP, boxStopDrag);
function boxStartDrag(event:MouseEvent):void {
box1.startDrag();//引数は未記述
}
function boxStopDrag(event:MouseEvent):void {
box1.stopDrag();
}
box1.buttonMode = true;//MCをボタンMCのようにカーソルを変えます。
//ドラッグ範囲のプロパティ
var rec:Rectangle = new Rectangle(20, 20, 180, 10);
box1.addEventListener(MouseEvent.MOUSE_DOWN, boxStartDrag);
box1.addEventListener(MouseEvent.MOUSE_UP, boxStopDrag);
function boxStartDrag(event:MouseEvent):void {
box1.startDrag(false, rec);//第2引数に設定したRectangleを入れます。
}
function boxStopDrag(event:MouseEvent):void {
box1.stopDrag();
}
コメント
コメントの投稿