Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Button Event Question

I'm building a game where I want to have a "Button Press", "Button Release" and "Button Out" event attached to a button. The only button event I can get to work is the 'click' event. What is the best way of adding these events to the button?

Here is the code that works. How can I set this for the Button Press and Button Release,etc:

leftButton.addEventListener('click', function()
{
    Titanium.API.debug("BUTTON CLICKED");
});

Thanks,

Andrew

— asked April 16th 2010 by Andrew Charon
  • iphone
0 Comments

1 Answer

  • How about "touchstart" and "touchend"? although I am not quite sure why you will want to bind 3 events like that…

    https://developer.appcelerator.com/apidoc/mobile/1.2/Titanium.UI.Button

    — answered April 17th 2010 by Raul Riera
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.