kineticjs - More than one draggable image events in Kinect -
i'm creating script draggable images alter src when double clicked : draggable image event in kinect
earlier question answered , works great though if add together object alter src when double-clicked nil works.
what problem?
you have have set of different image , click event. jsfiddle: http://jsfiddle.net/bighostkim/8bcxk/
var imageobj2 = new image(); imageobj2.src = 'http://www.html5canvastutorials.com/demos/assets/yoda.jpg'; var yoda2 = new kinetic.image({ x: 300, y: stage.getheight() / 2 - 59, width: 106, height: 118, image: imageobj2, draggable: true }); layer.add(yoda2); var imgindex2 = 0; yoda2.on('click',function() { imageobj2.src = images[ imgindex2++ % 3 ]; layer.draw(); })
javascript-events kineticjs
No comments:
Post a Comment