[SOLVED] self:setFillColor() problem

Whats wrong with the following code

 function toucher (event,self)  
 if(event.phase == "began") then  
 self:setFillColor(240,240,240)  
 end  
 end  
  
  
  
  
 Rect1:addEventListener("touch", toucher)  

I think it has to be that it thinks self is an object… but how would i fix this?
Thanks! [import]uid: 24708 topic_id: 25638 reply_id: 325638[/import]

function toucher (e)
if(e.phase == “began”) then

e.target:setFillColor(240,240,240)

end
end
For anyone who will have the same problem, this is what i used to fix it. [import]uid: 24708 topic_id: 25638 reply_id: 103630[/import]

I don’t think parameter self is passed to toucher in this case. Only one parameter is passed, “event”, which contains an entry “target” referring to the object touched.

[lua]function toucher (event)
if (event.phase == “began”) then
event.target:setFillColor(240,240,240)
end
end

Rect1:addEventListener(“touch”, toucher)[/lua]
[import]uid: 84768 topic_id: 25638 reply_id: 103631[/import]