trouble with addEventListener

so heres a crude angrybirds that i found on youtube and I did the tutorial but I have a problem on the last line of code when I try to click the circle:

local physics = require(“physics”)

physics.start( )

local circle = display.newCircle( display.contentCenterX -100, display.contentCenterY, 20 )

physics.addBody( circle, “dynamic”, {density = 1.0, friction = 0.3, bounce = 0.2, radius = 20} )

local floor = display.newRect( 284, display.contentCenterY +150, 570, 4 )

physics.addBody( floor, “static”, {density = 1.0, friction = 0.3, bounce = 0.2} )

for i = 0, 10 do 

local rect = display.newRect( display.contentCenterX + 50, (display.contentCenterY - 100) + (20 * i), 20, 20 )

physics.addBody( rect, “dynamic”, {density =1.0, friction = 0.3, bounce = 0.0})

end

function circleTouched(event)

if event.phase == “began” then

display.getCurrentStage():setFocus(circle)

elseif event.phase == “ended” then

circle:applyLinearImpulse( ((event.xStart - event.x) / 2), ((event.yStart - event.y) / 2), circle.x, circle.y )

display.getCurrentStage():setFoucs(nil)

end

end

circle:addEventListener( “touch”, circleTouched )

Im also curious why my debugger doesnt output anything useful when the simulator errors

Thanks, -hendrix.k99

P.S. my code starts on line 9 on my editor

First, in the future, please use the code formatting tool for all posts including code and spend some time making the code legible.  You’ll get more answers if you don’t force us to read a mish-mash. formatyourcode.jpg

Second,  the error I see is on this line:

display.getCurrentStage():setFoucs(nil) -- setFocus() not setFoucs()

As far as the debugger not printing anything useful?  I am a little surprised there is no error message.  I don’t use it that much though, so I’m not 100% sure one should expect every error message to come out of the debugger.  It may simply not have made it far enough to print one.

thanks roaminggamer, ill have to read my code more carefully before posting next time, and thx for the code formatting tip

-hendrix

First, in the future, please use the code formatting tool for all posts including code and spend some time making the code legible.  You’ll get more answers if you don’t force us to read a mish-mash. formatyourcode.jpg

Second,  the error I see is on this line:

display.getCurrentStage():setFoucs(nil) -- setFocus() not setFoucs()

As far as the debugger not printing anything useful?  I am a little surprised there is no error message.  I don’t use it that much though, so I’m not 100% sure one should expect every error message to come out of the debugger.  It may simply not have made it far enough to print one.

thanks roaminggamer, ill have to read my code more carefully before posting next time, and thx for the code formatting tip

-hendrix