Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-22-2013, 02:04 AM   PM User | #1
dojob
New to the CF scene

 
Join Date: Jan 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
dojob is an unknown quantity at this point
Uncaught reference error

I got Uncaught ReferenceError: Point is not defined for the following code. Anyone know what is the reason. I am suspecting that this is due to the fact that it does not have the function Point(). But the book also does not provide function Point() in this example.

Reference book

Quote:
function setupCurrentLevel(){
untangleGame.circles = [];
var level = untangleGame.levels[untangleGame.currentLevel];
for(var i = 0; i < level.circles.length; i++){
untangleGame.circles.push(new Point(level.circles[i].x, level.circles[i].y, 10));
}

// setup line data after setup the circles
connectCircles();
updateLineIntersection();
}
dojob is offline   Reply With Quote
Old 02-22-2013, 07:19 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,210
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Correct.

But it looks like that chapter is building on the work in prior chapters, and I'll bet that Point is defined in one of the prior chapters.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:07 AM.


Advertisement
Log in to turn off these ads.