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 971291
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:56:26+00:00 2026-05-16T02:56:26+00:00

I will put my code in a simple way, but if any good soul

  • 0

I will put my code in a simple way, but if any good soul wants to help the code is |on Github| /lib/inmotion/editor.js(line 99)

editor.js

function Editor(){
  var instance = this;
  this.key_frames = [] // a list of key frames
  this.kf = null   // the current KeyFrame

  function notice_click( click ){
    instance.kf.add_bone( 1 ) // <-- error here
    // instance.kf.list.push( 1 ) // <-- this works, but is incomplete
  }
}

key_frame.js

function KeyFrame(){
  instance = this
  instance.changed = false // for the redraw :)
  instance.list = []

  function add_bone( bone ){
    instance.list.push( bone )
    instance.changed = true
    return true
  }
}

My program has an unique Editor instance that has lots of instances of KeyFrames.
Each KeyFrame holds lots of bones.
So there is always one active KeyFrame, defined by instance of Editor.kf
As I only have one kf, I can add bones to that one with no problem, but as I add more KeyFrames I can only add_bone to the last kf I created! Why?

If I was not clear enough, I apologize, ask on doubt

  • 1 1 Answer
  • 1 View
  • 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-05-16T02:56:27+00:00Added an answer on May 16, 2026 at 2:56 am

    Your KeyFrame object is missing a var, it should look like this:

    function KeyFrame(){
      var instance = this;
      instance.changed = false;
      instance.list = [];
    
      function add_bone( bone ){
        instance.list.push( bone );
        instance.changed = true;
        return true;
      }
    }
    

    Without the var keyword you’re defining or overwriting window.instance, a global variable, not a local one to the object like you want 🙂

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

Sidebar

Related Questions

I'm trying to write a small wsgi application which will put some objects to
I have recently been put in charge of debugging two different programs which will
Two Questions: Will I get different sequences of numbers for every seed I put
With VIM or Emacs I can put comments in the file that will be
For testing purposes I'm planning to put together a little app that will listen
When using TempData, my understanding is that it will keep whatever you put in
In a multi-server environment, users will be able to use a page to put,
Will the code below work if the clock on the server is ahead of
I'm new to C# and don't have any programming experience. But I've finish a
This will probably be a bot of a waffly question but ill try my

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.