1.2 bug?

Hi there,

Just having a play with Director 1.2 which looks really cool!

However, think I’ve discovered a bug. I’ve got a couple of screens one with a graphic (320 x 480) and another screen with a newRect (320 x 480) and a UI Button on the top with up and down images.

I’ve got a button:addEventListener with a director:changeScene(“game”,“crossfade”) to go to the screen with the graphic on it and then the graphic screen just has a runtime:addEventListene which switches back to the previous screen.

This works fine in 1.1 and also works fine in 1.2 as expected the two screen switch smoothly with the effect.

However in 1.2 on the button screen if you click OFF the button anywhere else on the screen and then click the button, the button stops operating. A refreshed of the simulator and all works again.

I switched director to 1.1 and this works fine, obviously without the crossfade effect.

Is this a bug or have I coded something wrong for the new 1.2?

[lua]local ui = require(“ui”)
local button = ui.newButton{
text = “Test Button”,
size = 12,
textColor = {0,0,0,255},
default = “up.png”,
over = “down.png”
}
button.x = 138
button.y = 275
button.isVisible = true

this:insert(button)
this.button = button

function loadGame(event)
if event.phase == “ended” then
director:changeScene(“cl”,“crossfade”)
end
end
this.button:addEventListener(“touch”, loadGame)[/lua] [import]uid: 33866 topic_id: 6649 reply_id: 306649[/import]

Are you removing the runtime listener? [import]uid: 9371 topic_id: 6649 reply_id: 23185[/import]

This is not a bug of 1.2, please take a look at the sample to see how to use properly the UI buttons. [import]uid: 8556 topic_id: 6649 reply_id: 23186[/import]

dweezil: Well spotted, yes it was the runtime listener!

I just changed the runtime listener to listening for the image being touched and the button on the other screen works perfectly.

Bit confused though why the runtime listener worked in version 1.1 and not in version 1.2. But anyway shouldn’t of used the runtime listener really.

Thanks for your help. [import]uid: 33866 topic_id: 6649 reply_id: 23187[/import]