Hi all and thanks in advance for any help anyone can offer on this

I'm having a bit of trouble with scope and calling a function from inside a callback. For example if I have a prototype set up like this :

MainAssistant.prototype.setup = function() {
	randomMode = 1; // set default random generation mode (phrase)
	$("divOutput").innerHTML = "Tap Generate to get started!"; // set initial message to user indicating a button tap is necessary
	// set up command menu at the bottom of the screen
	this.cmdMenuModel = {
	    visible: true,
	    items: [
				{label: $L('last'), icon:'save', command: 'last'},
                                {label: $L('fav'), icon:'save', command: 'favorite'}
			}, { label: $L('Generate'), icon: '', command: 'generate'}
 	this.controller.setupWidget(Mojo.Menu.commandMenu, undefined, this.cmdMenuModel);

MainAssistant.prototype.doSomething = function() {
    // stuff happens

MainAssitant.prototype.handleCommand = function() {
      if(eventObj.type == Mojo.Event.command) {
		switch(eventObj.command) {

			case 'generate':
The handleCommand() function is bound to the command menu, the doSomething() function call within it returns undefined when the user presses the corresponding button and I can't seem to figure out how to make that work. I know it's a scope issue but I'm at a loss on how to make it work right.. I've been Googling a bit and haven't really turned up anything so far.

I know I'm kind of newbie at this, so any insight anyone can share would be great

Thanks in advance!