Thursday, October 2, 2008

Creating draggable objects

insertnamehere.addEventListener(MouseEvent.MOUSE_DOWN,
DragStart)
insertnamehere.addEventListener(MouseEvent.MOUSE_UP,
DragStop)
function DragStart(event:Event){
event.target.startDrag(false)
}

function DragStop(event:Event){
event.target.stopDrag()
}


*****note the DragStart) and DragStop) needs to go on the lines prior too, this blog was cutting off the code so i had to put it on another line. not sure if that really makes a difference or not but just in case

1 comment:

Hung-Hsuan Lo (Sandra) said...

Michelle, you are awesome! I have been tried two days to figure out how to use bottom and link to another scene. Now, I may just have to change my plan...