Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

    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();
    }

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,211
    Thanks
    80
    Thanked 4,571 Times in 4,535 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •