Strings can work fine for event names, I think op is overstating the string hell factor. But say you wanted to eliminate them you could do something like:
var firstTouchBehaviour = {
touchCount: 0,
events: {
firstTouch: 'FirstTouch'
},
setup: function(owner) {
andro.eventer(owner).bind(this, "touch", function(contact) {
if(contact === "added") {
if(this.touchCount === 0) {
andro.eventer(owner).emit(this.events.firstTouch);
}
this.touchCount++;
} else if(contact === "removed") {
this.touchCount--;
}
});
}
};
and var soundBehaviour = {
setup: function(owner) {
andro.eventer(owner).bind(this, firstTouchBehaviour.events.firstTouch , function() {
console.log("Rarrrrrwwwwwwwwwwwwwwww");
});
}
};