title: Corona simple eventListener
body: <p>I can't figure out why my button won't change appearance when pressed, can anyone tell me if there is something wrong with  the following snippet. I am using Corona SDK</p>
  
  <p>This is my complete main.lua, if i remove the event listener the buttonswap works.</p>
  
  <pre><code>display.setStatusBar(display.HiddenStatusBar);
  
  local textObj = display.newRetinaText("Click and see what happens!", 40, 40, nil, 0)
  textObj:setTextColor(255,0,0);
  
  local widget = require "widget";
  
  local button = widget.newButton{
      default = "Button.png",
      over = "ButtonClicked.png",
      onPress = button.touch;
        }
  
  button.x = display.contentCenterX;
  button.y = display.contentCenterY+200;
  
  local function touch(e)
  if(e.phase == "began")then
          textObj.text = "Clicked!";
          textObj:setTextColor(255,255,255);
  elseif(e.phase == "ended") then
          textObj.text = "Released!";
          textObj:setTextColor(255,0,0);
      end
  end
  </code></pre>
  
  <p>Now i can only see the text, and not the button!</p>