I am making an application in which user can drag & drop multiple objects from a toolbar onto a canvas.After dragging and dropping that particular object onto the canvas the user can move that object around in the canvas.Double Clicking on that object will make it disappear.I have been able to implement this for one object in the toolbar as shown in the link below..
To drag & drop multiple objects from the toolbar I made the following additions in the function DragDrop()
var image2 = new Kinetic.Image({
name: data,
id: "image"+(imageCount++),
x: x,
y: y,
image2: theImage2,
draggable: true
});
image2.on('dblclick', function() {
image2.remove();
layer.draw();
});
layer.add(image2);
layer.draw();
var image3 = new Kinetic.Image({
name: data,
id: "image"+(imageCount++),
x: x,
y: y,
image3: theImage3,
draggable: true
});
image3.on('dblclick', function() {
image3.remove();
layer.draw();
});
layer.add(image3);
layer.draw();
The Fiddle containing the above code is http://jsfiddle.net/gkefk/29/
Even though I've made the necessary additions in the DragDrop() function, the two new objects are visible in the toolbar but i'm not being able to drag,drop,move around and delete them like the first object.Please Help...