Here's my code (It doesn't work):

var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");


function Shape(){};

Shape.prototype.Circle = function(){
    // Some code here
};

Shape.prototype.Square = function(){
    // Some code here
};


MainMenu.prototype = new Shape();

var MainMenu = function(ctx){
   this.draw{
    this.Circle();
    this.Square();
   }
}

What I want to do is to call the Circle() and Square() function inside my draw() function.
Is this even possible??
I'm going crazy trying to figure this out!!

Troy III commented: Your question has been answered - you should mark the thread "Solved" -2
  1. this.Circle();
  2. this.Square();

...is the same as if you'd stated:

  1. MainMenu.Circle...
  2. MainMenu.Square

But the "MainMenu" doesn't have the "Circle" method!
You wrote it for "Shape".
[and this is just to begin with, since there are several other errors on the path]

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.