Skip to content

Instantly share code, notes, and snippets.

@pec1985
Created September 23, 2014 00:31
Show Gist options
  • Save pec1985/1a93c0c93aa1ff4683df to your computer and use it in GitHub Desktop.
Save pec1985/1a93c0c93aa1ff4683df to your computer and use it in GitHub Desktop.
Events on buttons
var win = Ti.UI.createWindow();
var btn = Ti.UI.createButton({
title: 'click me'
});
win.add(btn);
win.open();
btn.addEventListener('click', function () {
Ti.API.info('First "click" event on the button fired!');
});
btn.addEventListener('click', function () {
Ti.API.info('Second "click" event on the button fired!');
});
btn.addEventListener('click', function () {
Ti.API.info('Third "click" event on the button fired!');
});
btn.addEventListener('click', function () {
Ti.API.info('Fourth "click" event on the button fired!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment