-
Dragging the entire screen? (startDrag)
I'm trying to get objects to drag and drop.
Instead of dragging just the circle, it drags the entire screen. I can get it to work if I use "this.circle.startDrag()" but I want to be able to use the startMove and stopMove functions on different children, text boxes and other objects generically. Here's the code:
circle.addEventListener(MouseEvent.MOUSE_DOWN, startMove);
circle.addEventListener(MouseEvent.MOUSE_UP, stopMove);
function startMove(event:MouseEvent):void {
this.startDrag();
}
function stopMove(event:MouseEvent):void {
this.stopDrag();
}
Any idea how I can get this to work?
-
Bearded (M|G)od
function startMove(event:MouseEvent):void {
event.currentTarget.startDrag();
}
function stopMove(event:MouseEvent):void {
event.currentTarget.stopDrag();
}
-
I tried that but it gives me an error:
"Property startDrag not found on flash.display.Loader and there is no default value."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|