Here is my issue, I have an event that is on a sprite and when I click it, it sets the clicked sprite to the front, as I read before, you just need to addChild again and it will be at the front, but if I keep clicking this I get the attempt to index a nil value error.
if self then self:getParent():addChild(self) end
includes/menu.lua:239: attempt to index a nil value
it is inside a mouseDown event.
Anything I can look for to help?
REAL programmers type copy con filename.exe
---------------------------------------
Comments
I found the Culprit it seems, I mis understand the aaEventListerner.
I use the parent for the base, and then the child in the paramter, by changing the base to the child, fixed the problem.
container.sprite:addEventListener(Event.MOUSE_DOWN, onMenuAvatarMouseDown, touch[row].sprite)
Change to
touch[row].sprite:addEventListener(Event.MOUSE_DOWN, onMenuAvatarMouseDown, touch[row].sprite)
Can anyone explain this to me. the guide is a bit vague in reasoning.
yep pasted wrong.....
---------------------------------------