Hello,
I’m using the Director class, working with 2 scenes.
When I go from scene 1 to scene 2 the first time everything works fine, but if I do: from scene 1 to scene 2; from scene 2 to scene 1; from scene 1 to scene 2, I’ve got a problem.
The code of scene 2 is something like this:
local scrollNav = require("scrollNav")
local function itemSelected(event)
print(event.target) --Here is the problem! It prints once when go into scene 2 for the first time, prints 2 times when go to scene 1 and then to scene 2 and so on...
end
Runtime:addEventListener("scrollNav.itemSel", itemSelected)
And in the scrollNav.lua got something like this:
local event = { name="scrollNav.itemSel", target=foo }
Runtime:dispatchEvent(event) --I've checked and it dispatches only once allways
Please, could anybody help me?
TIA
[import]uid: 44013 topic_id: 11091 reply_id: 311091[/import]