locbtran Posted May 28, 2013 Share Posted May 28, 2013 Here's my code: var c=document.getElementById("myCanvas");var ctx=c.getContext("2d"); var Shape = function(){} 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.But it doesn't work.Is this even possible??I'm going crazy trying to figure this out!! Link to comment Share on other sites More sharing options...
Ingolme Posted May 28, 2013 Share Posted May 28, 2013 Something seems to be wrong with this syntax: this.draw{ this.Circle(); this.Square(); } Link to comment Share on other sites More sharing options...
thescientist Posted May 29, 2013 Share Posted May 29, 2013 try looking in your error console. the syntax error is pretty clear just by looking at the code though. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now