Draggable image event in Kinect

I’m creating a script where image is draggable and can change the image source when double clicked.

Moving the image works ok and when double clicking the image (event is dblclick) the image changes but same time appears as double where another identical image appears in the original position.

Code is:

var picture = new Image();
picture.onload = function() {
   var picture = new Kinetic.Image({
   x: 10,
   y: 10,
   image: picture,
   draggable: true,
   width: 100,
   height: 200
});

picture.on('dblclick', function() {
   picture.src = 'images/picture2.jpg';
});

layer.add(picture);
stage.add(layer);

}

picture.src = 'images/picture1.jpg';

What am I doing wrong?

75 thoughts on “Draggable image event in Kinect”

  1. Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter
    updates. I’ve been looking for a plug-in like this for quite some time and was
    hoping maybe you would have some experience with something like
    this. Please let me know if you run into anything. I truly enjoy reading your blog
    and I look forward to your new updates.

    Have a look at my web blog: poker deposit via pulsa

    Reply
  2. After going over a few of the blog posts on your website, I honestly appreciate your way of
    blogging. I bookmarked it to my bookmark site list and will be checking back soon. Please visit my website as
    well and tell me how you feel.

    Reply
  3. I absolutely love your blog.. Very nice colors & theme.
    Did you create this web site yourself? Please reply back as I’m looking to create my
    own personal site and would like to learn where you got this from or exactly what the theme is
    named. Thanks!

    Reply
  4. I do believe all the concepts you’ve presented to your post.
    They’re really convincing and can certainly work. Still,
    the posts are very quick for newbies. Could you please extend them a bit from next time?
    Thanks for the post.

    Reply
  5. Fantastic beat ! I wish to apprentice while you amend
    your web site, how can i subscribe for a blog site? The account aided me a acceptable deal.
    I had been a little bit acquainted of this your broadcast provided bright clear idea

    Reply
  6. I was recommended this website through my cousin. I’m
    no longer positive whether or not this post is
    written through him as no one else recognise such detailed approximately my difficulty.

    You are amazing! Thank you!

    Reply
  7. Heya i am for the first time here. I came
    across this board and I in finding It truly helpful &
    it helped me out much. I hope to give one thing back and aid others such as
    you aided me.

    Reply
  8. of course like your web site but you need to check the spelling on quite a few of your posts.
    Many of them are rife with spelling problems and I to
    find it very bothersome to tell the reality on the
    other hand I’ll definitely come again again.

    Reply
  9. I just like the valuable info you provide for
    your articles. I’ll bookmark your weblog and check nce more rright heee frequently.
    I am rather certain I will be informed lots of new stuff proper here!
    Best of luck ffor the following!

    Feel free to visit my web site :: Chaturbate

    Reply
  10. Please let me know if you’re looking for a article writer for your blog.
    You have somje really great articles and I believe I would be a good asset.

    If you evesr want to take somke of the load off, I’d really like to write some content for your blog in exchange for a link back
    to mine. Pleaswe send me an email if interested. Regards!

    Here iis my wweb blog :: highly recommended Pornhub

    Reply
  11. When I initially commented I clicked tthe “Notify me when new comments are added” checkbox and now
    each time a commment is added I get several e-mails with the same comment.
    Is there anny way you can remove me from that service? Thank you!

    Heere is my homepage … enjoy live sex

    Reply
  12. A person essentially help to make significantly posts
    I’d state. This is the first time I frequented your web page and
    so far? I surprised with the analysis you made to make this actual
    submit extraordinary. Great process!

    my web-site: fake cam

    Reply

Leave a Comment