- (id)init { if ((self = [super init])) { // create our two buttons SPButton *yesButton = ...; SPButton *noButton = ...; // add them to the display tree [self addChild:yesButton]; [self addChild:noButton]; // listen for their TRIGGERED events [yesButton addEventListener:@selector(onYesTriggered:) atObject:self forType:SP_EVENT_TYPE_TRIGGERED]; [noButton addEventListener:@selector(onNoTriggered:) atObject:self forType:SP_EVENT_TYPE_TRIGGERED]; } return self; } // the listener we created for the yes-button: - (void)onYesTriggered:(SPEvent *)event { SPEvent *localEvent = [SPEvent eventWithType:EVENT_TYPE_YES_TRIGGERED]; [self dispatchEvent:localEvent]; } // the listener we created for the no-button: - (void)onNoTriggered:(SPEvent *)event { SPEvent *localEvent = [SPEvent eventWithType:EVENT_TYPE_NO_TRIGGERED]; [self dispatchEvent:localEvent]; }