[Xerte] Very simple Drag and drop

Tenney Julian Julian.Tenney at nottingham.ac.uk
Mon Oct 1 09:10:33 BST 2007


Hi,

So you have two items, a fish and a bird. You want both items to be
draggable to the net. If the fish is dropped there, then the feedback
'well done' is shown, and the piece moves on; conversely if the bird is
dropped there, it is returned to it's original position and you say
'Nope, try again'.

So, set up the fish and the bird as graphic icons. Give them each an ID,
i.e. fish and bird;

Add a text icon to the flowline and call it feedback, give it the id
feedback. We'll use code to display feedback in this, so don't type
anything in it just yet.

Add an interaction to the flowline and give it an ID, i.e. myInt;

Add a target area to the interaction;

Press SHIFT-F5 and position / size the target area where you want it
(probably over your graphic of the net);

In the properties for the target area response type
bird~leave~0,fish~leave~0. This sets up the response to match both the
fish and the bird.

Now add a script icon to the target area response. You will write some
code now that checks to seee which item was dropped. In the script icon,
type this code:

if (myInt.objectDropped == fish){
  //the user dropped the fish
  feedback.setText("Well Done");
}

if (myInt.objectDropped == bird){
  //the user dropped the bird
  feedback.setText("Nope, try again.");

  //return the bird to its starting position (you need to know the x and
y values)
  bird.animate(10,10,10,'linearTween');
}

Check the sample I just built at:

www.nottingham.ac.uk/~cczjrt/simpleDragDrop.zip

The reason you find it complicated to build drag and drop is because
they are complicated. They are always the most complex interactions to
put together, and the reason for that is there are so many ways of
designing one: broadly, you can have oneItem-oneTarget,
manyItems-oneTarget, oneItem-manyTargets or manyItems-manyTargets types
of drag&drop interaction, and in each case you can have correct and
incorrect items. There are other things you may want to do, like tile
the items as they are dragged into a box, or sort items based on some
criteria.

Regards,

Julian






-----Original Message-----
From: xerte-bounces at lists.nottingham.ac.uk
[mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of E.A. Draffan
Sent: 30 September 2007 21:26
To: 'Xerte discussion list'
Subject: [Xerte] Very simple Drag and drop

As a complete newbie to interactive Xerte I have been struggling to get
a simple drag and drop with two items and one target to work -  the fish
goes to a net but if the bird is sent to the net it springs back - 'well
done'
comes up when the fish is in the net and then the user goes to the next
slide.  

The drag and drop sample on the Xerte site seems to want to debug itself
when I run it and does not tell me whether I have submitted the right
collection of words to the tick, cross or tin can and I feel it is a bit
too complex for learning disabled adults - the users I am working with
for this exercise.  It is designed to enhance mouse or keyboard use as
well as to be a learning task having listened to an audio file on the
subject of fishing. 

I am wondering if anyone has an rlo that I could blatantly copy!  (she
says
blushing!)  I have to admit that I have been trying to track down flash
files on the web and most are once again too much for this audience. I
am happy to share the final result with anyone who wants to use the
templates if they work!!! 

Best wishes E.A.

Mrs E.A. Draffan
Learning Societies Lab
ECS, University of Southampton
Tel: +44 (0)23 8059 7246
http://www.lexdis.ecs.soton.ac.uk
http://www.emptech.info/

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.13.35/1039 - Release Date:
29/09/2007
21:46
 

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte


More information about the Xerte mailing list