Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8747247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:19:30+00:00 2026-06-13T12:19:30+00:00

I am using the latest kineticjs.(v.3.10) Here is the problem I am using a

  • 0

I am using the latest kineticjs.(v.3.10)
Here is the problem

I am using a single function to send images to the canvas which are outside the canvas on click.
I am making the images draggable and all..
I have also added a remove image function on double click.
when I double click on any image..
the last added image gets removed and after that if I try to click on some other image..
I get this error: TypeError: this.children[child.index] is undefined

Here is a little code.:

Using this function to fetch the path from another file using ajax

       function loadajax(imgpath,imgid){

            sources = {
            yoda1 : imgpath,
        };
        loadImages(sources,initStage1);
      };

Sources function:—-

       function loadImages(sources, callback){
        var images = {};
        var loadedImages = 0;
        var numImages = 0;
        for (var src in sources) {
          numImages++;
         }
        for (var src in sources) {
          images[src] = new Image();
          images[src].onload = function(){
          if (++loadedImages >= numImages) {
              callback(images);
           }
         };
     images[src].src = sources[src];
       }
     }

Here is the function that I’m using to remove/drag and drop/etc..

             function initStage1(images){ 
            yodaGroup1 = new Kinetic.Group({
            x: 100,
            y: 110,
           draggable: true,
            });
            layery = new Kinetic.Layer();
            layery.add(yodaGroup1);
            stage.add(layery);
            var yoda1 = new Kinetic.Image({
            image: images.yoda1,
            x: 0,
            y: 0,
            width: 100,
            height: 120,
            name:"image",
            detectionType:"Pixel"
            });



    yodaGroup1.add(yoda1);
    yodaGroup1.on("dragstart", function() {

          yodaGroup1.moveToTop();
          layery.draw();
        });
    yodaGroup1.on("dblclick dbltap", function() {
          layery.remove(yodaGroup1);
          layery.draw();
        });          
    yodaGroup1.on("dragend", function() {
            layery.draw();
            yoda1.saveImageData();
                    });
    addAnchor(yodaGroup1,0, 0, "topLeft");
    addAnchor(yodaGroup1, 100, 0, "topRight");
    addAnchor(yodaGroup1, 100, 120, "bottomRight");
    addAnchor(yodaGroup1, 0, 120, "bottomLeft");




    stage.draw();   
    yoda1.saveImageData();         

        }

NOW according to this function
I should be able to add the images to the canvas(which is working fine)
Should be able to move one image over another when I drag it (.ie.moveToTop function)_Not working
Should be able to remove the images on double click(working only for the latest added image)

Please help

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:19:31+00:00Added an answer on June 13, 2026 at 12:19 pm
    layery.remove(yodaGroup1);
    

    refers to this function :

    • remove() remove layer from stage

    http://www.kineticjs.com/docs/symbols/Kinetic.Layer.php#remove

    There is no function to remove only one node contained in the layer :/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jQuery(Latest release) and have a function called calculate() which gets called
I am using latest Jquery and the following script: <script type=text/javascript> $(document).ready(function(){ var el
Hello I have a problem using latest vim with omnicompletion while editing a file
Using latest CTP5 with async/await keywords, I wrote some code, which apparently cannot compile:
I'm using v3.10.2 of Kineticjs. I'm following the official demo The problem is at
Using latest php in order to create a function that adds a row to
I am using latest Pyramid to build a web app. Somehow we have started
I'm using latest MVC4-RC (.net 4.0) with Microsoft ASP.NET Web Optimization Framework http://nuget.org/packages/Microsoft.AspNet.Web.Optimization/1.0.0-beta3 and
I am using latest Google IMA SDK for video ads, in that the flash
Does anybody using latest enterprise library 4.1 in mono? I used mono migration analyzer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.