Page 1 of 1

Drag Drop Action

PostPosted: Fri Mar 18, 2005 5:12 am
by Guest
Trying out the drag'n'drop in NB5 ... but can`t work out how to make something happen if object succesfully dropped into selected drop zone...

eg...

If object 1 successfully dropped into dropzone1 "sound buzzer"... else do nothing.

I'm sure this is simple...

PostPosted: Fri Mar 18, 2005 5:26 am
by Guest
you could try .... the system sound function ... that works .... as far as the soundbuzzer or playtone functions ... I can't get them to work either ... I seems to me alot of stuff don't work in nb5 for some reason.

PostPosted: Fri Mar 18, 2005 5:31 am
by Sam Cox
Hi domino,

In the Jigsaw Puzzle pub, edit the DragDrop code in one of the puzzle pieces to read (for example):
Code: Select all
SetVar "[DropAccept]" "True"
If "[DropTarget]" "=" "LowerRight"
SoundBuzzer
Endif

instead of just
Code: Select all
SetVar "[DropAccept]" "True"

That should do it for you.

And ... SoundBuzzer and Playtone are working on my copy of NB5 running WIN2K SP4.

-- Sam

PostPosted: Fri Mar 18, 2005 5:31 am
by Guest
Taken from NB5 sample file US Presidents.pub:

Code: Select all
If "[DropTarget]" "=" "LincolnDrop"
  ShowObject "Lincoln" "None" "0"
  PlaySoundFile  "Ding.wav" "Normal"
Else
  If "[DropTarget]" "=" "Rectangle1"
    HideObject "Lincoln" "None" "0"
  Else
    PlaySoundFile  "Error.wav" "Normal"
  EndIf
EndIf

Thanks...

PostPosted: Fri Mar 18, 2005 5:43 am
by Guest
Thanks...

I was too quick to post..

I hadn`t spotted the new predefined global variables and to further compound my shame.. there is a good explanation in the help file...

I`ll put on my hair shirt now :oops: