edit: I found the problem with my code - see my answer for the solution.
Just a quick question:
I want to access an instance of an class inside of another class - how can i do that? Here is a quick example of my problem:
var instanceA = new ClassA();
function ClassA(){
    var instanceB = null;
    this.start = function(){
        instanceB = new ClassB();
        instanceB.start();
    }
    this.action = function(){
        console.log('works not');
    }
} 
function ClassB(){
    this.start = function(){
        instanceA.action(); // this throws: Uncaught ReferenceError: instacneA is not defined 
    }
} 
 
     
    