hello, i was under the impression that you need to do a hit test to drag a specific object around. matter of fact all the books ive looked at and all the tutorials say use code similar to below:
however, i just found a tutorial that uses the following code. please note: i am using on() events (which i thought could only be used for buttons) on a movie clip. there is no button being used. its all attached to the movie clip:
on(press){
this.startDrag();
}
on(release){
this.stopDrag();
}
now my question is, why does everyone use the hitTest.
heres the .fla
also please note: the hitTest way of doing it seems to BREAK if you drag the object really fast. the object seems to stick to the cursor even though you its suppose to stopDrag....try it out. the on(release) way of doing it never breaks.
also, do you know how to prevent the object from sticking to the cursor?
thank you. can you tell me what is the most common way to make the movie clip draggable?
also, can you tell me what the
onClipEvent(enterFrame){
updateAfterEvent();
}
is for?
also, if im directly referencing the movie clip by _root.dragmovie.hitTest why would this.hitTest work better? wouldnt that be the same? either way right?
updateAfterEvent REALLY solves that sticky movieclip problem but can you tell my WHY. shouldnt the code work regardless? if i tell flash to STOPDRAG when mouse is up then why doesnt always do it? is this a bug?
also, i tried the dragmovie.onPress = function
exactly as you have it but it doesnt work. i applied it to a movie clip that sits on the main timeline. heres my code.