Win Function Confusing

Ok, so I’ve made it so that when the image is clicked, it advances to the next level. I’ve also made it so that the, isVisible function is false, when it’s first displayed. And when you win, it shows. However, when I launch it, it’s visibility is true. How is this so?

Please take a look at the coding and help me figure it out. Thanks!

[code]
local function winLose(condition)
if(condition == “win”) then
display_txt.text = “WIN!”;
win.isVisible = true
win.isBodyActive = true
localGroup:insert(win)

elseif(condition == “fail”) then
display_txt.text = “FAIL!”;
end
end

local win = display.newImage(“youwin2.png”)
win.x = display.contentWidth/2
win.y = display.contentHeight/2
win.isVisibile = false
win.isBodyActive = false

local onWinTouch = function (event)
if event.phase == “ended” then
director:changeScene( “level2”)
end
end
win:addEventListener(“touch”, onWinTouch)
[/code] [import]uid: 19768 topic_id: 6894 reply_id: 306894[/import]

you spelled isVisible wrong!

[lua]win.isVisibile = false[/lua]

[import]uid: 6645 topic_id: 6894 reply_id: 24137[/import]

Oh. wow… haha that’s embarassing. I should’ve checked that. Especially when the earlier isVisible = true, is spelled correctly.

Haha wow. Thanks a lot :slight_smile: [import]uid: 19768 topic_id: 6894 reply_id: 24144[/import]