Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 21st, 2025, 5:37 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: drag and drop help
PostPosted: November 10th, 2004, 12:07 am 
Offline

Joined: November 9th, 2004, 11:58 pm
Posts: 3
Help! This is driving me mad! How can you find out what object has been dropped onto another object. I have some basic sums using a random number and then an empty frame on which the correct object has to be dragged to equal the displayed answer (they all add up to ten). The random value is a variable and the draggable number is also a variable. How can I test what has been dragged onto the empty frame? I have been trying to sort this out all afternoon and I'm going round in circles so any help would be appreciated.

Oh also, is there any way of rejecting a dropped object if the value is wrong?

Thanks


For this message harkers has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 10th, 2004, 8:47 am 
Offline

Joined: October 25th, 2004, 3:03 pm
Posts: 540
Location: Tyalgum Creek. Australia
Opus: Opus Pro Latest version 9.02 Build 16458
OS: Won 10
System: Asus laptop Intel Core i5 8 gig ram, big monitor, reading glasses
Hello Harkers

I presume you have set your random number to be within a known range say 1 to 20
One idea (untested) but worth a think about is using the If function to test whether or not the dropped object belongs.

If you can send me your imp file, I'll have a look at it for you.

Cheers

Graham

_________________
Too much coffee can result in frequent toilet breaks!


For this message Graham Baglin has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 10th, 2004, 12:09 pm 
Offline

Joined: November 3rd, 2004, 2:35 pm
Posts: 117
Location: Swansea, South Wales
The way that springs to mind for me...

Use a "This Object Dropped" trigger to add the variable contained in the relevant object to some test variable.

Then compare that test variable to your answer.

I've done a quick example. (I've haven't bothered to randomise the variables but the principle should work)


You do not have the required permissions to view the files attached to this post.


For this message leiafee has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 10th, 2004, 1:39 pm 
Offline

Joined: November 3rd, 2004, 2:35 pm
Posts: 117
Location: Swansea, South Wales
On the subject of rejecting the wrong answers I think you can only set up dropzones to accept/reject objects based on the object itself--not its contents.

I found a workaround using a "Mouse Down" trigger to test whether the object was correct as soon as you started dragging it.

Then I enabled or disabled the dropzone based on whether the answer was correct or not.

It's a bit more convoluted but I've got an example working.


You do not have the required permissions to view the files attached to this post.


For this message leiafee has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject: Drag and drop
PostPosted: November 10th, 2004, 5:38 pm 
Offline

Joined: November 9th, 2004, 11:58 pm
Posts: 3
Thanks for the replies everyone. One thing I forgot to say was that I am only uing Opus Pro 2.8 so I can't open the samples that you kindly put together! I've attached the sample page for your perusal. The idea will ultimately be to drag the correct number on to the question mark to make 10. Currently there is only one draggable object on there..


You do not have the required permissions to view the files attached to this post.


For this message harkers has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 11th, 2004, 11:24 am 
Offline

Joined: November 9th, 2004, 11:58 pm
Posts: 3
Thanks Bago and Leifee - using your prompts I've now managed to solve it. I set up a varibale which updates to the value of the object being dragged. i also get it's x,y position on mouse down. On the drop zone I then test if the random number plus the updated variable <>10 and if true send the object back to its original position.

The inability to reject drag and drop in script is a real pain when trying to test things! Bit of an oversight I reckon....

Cheers


For this message harkers has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 12th, 2004, 8:55 am 
Good on you Harkers

I downloaded your pub then installed ver 2.7 and could not remember how to get 2.8 So thought 2.7 would be OK

So had a look at your pub and couldn't figure out what you were trying to do and then my Internet connbection went down :shock:

Gald you have solved your problem in the meantime :D

I'm sure there is a simpler way, but if your solution works don't touch it. Always good advice.

Cheers

Graham


Top
   
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 66 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group