PDA

View Full Version : StopDrag on particular Event


stopsense
10-27-2001, 12:41 PM
Hi,

I have an annoying problem that should be fairly simple to fix .- Only with my limited capacities in ActionScript I cant seem to cut it -

I am doing a quiz where movieclips with invisible buttons are dragged over the correct dropTargets - When the correct combination is found (If .test=true) the Movieclip changes graphic (_root.Clip1.GotoandStop(2) and snaps to the DropTarget - Otherwise it goes back to original position (Else orgx etc.)

That works just swell - Now the problem :

When the movieClip has snapped it should STOP being draggable -

So everytime you have placed something correct it should be non-draggable - Right now when I drag the correct Movieclip from the dropTarget again it has TWO graphics frame 1 + 2 graphic

Not so cool !

What to do ... ? :-)

Best regards Theo

wangbar
10-27-2001, 05:23 PM
Since your clip goes to a different frame when it hits its target you could use this to set a flag which stops it being draggable...

if(_root.clip1._currentFrame==2){
_root.allowDragClip1=false;
}

On the invisible button that triggers the drag you could have something like...

on(press){
if(_root.allowDragClip1){
startDrag("",true);
}
}

stopsense
10-27-2001, 08:57 PM
Yup, - That was precisely what I was looking for - You are a Flash Demi-God : Wangbar - I bow in your general direction !

Best from Theo