Results 1 to 4 of 4
  1.    #1  
    Hey everyone, this seems like it should be quite simple, but it will not work for me. App menu works, has all options, the About option of the menu displays an alert, which works beautifully.

    The accounts option should push the "accounts" scene, but doesn't do anything. I have verified the event fires by adding some text to a div as well, however pushScene never seems to work.

    The accounts scene does work. If I push that as the initial scene it loads fine. Stuck. Thoughts please!


    Code:
    StageAssistant.prototype.setup = function() {
       this.controller.pushScene("launch");
       
       this.appMenuModel = {
              visible: true,
              items: [
                 Mojo.Menu.editItem,
                 { label: "Accounts", command: 'do-myAccts' },
                 { label: "About", command: 'do-about' },
                     { label: "Help", command: 'do-myHelp' }
              ]
           };
    }
    
    StageAssistant.prototype.handleCommand = function (event) {
       this.controller=Mojo.Controller.stageController.activeScene();
        if(event.type == Mojo.Event.command) {   
          switch (event.command) {
             case 'do-myAccts':
                this.controller.pushScene('accounts');
                break;   
             case 'do-myHelp':
                this.showHelp();               
                break;
                      
             // our app custom commands
             case 'do-about':
                this.controller.showAlertDialog({
                    title: $L("About"),
                    message: $L("Developed by Kyle Paul Johnson. Copyright 2009"),
                   choices:[
                   {label:$L('Ok'), value:"refresh", type:'affirmative'}
                      ]               
                    });
                break;
          }
       }
    }
  2. atlanta's Avatar
    Posts
    324 Posts
    Global Posts
    337 Global Posts
    #2  
    i had a similar problem try changing:

    this.controller.pushScene('accounts');

    to

    Mojo.Controller.stageController.pushScene('accounts');
  3. #3  
    delb, I use the same syntax that you use to push my scene from the app menu:

    this.controller.pushScene('accounts');

    It works in mine, and comparing code, I honestly don't see where it goes wrong.
  4. kesne's Avatar
    Posts
    471 Posts
    Global Posts
    491 Global Posts
    #4  
    Quote Originally Posted by atlanta View Post
    i had a similar problem try changing:

    this.controller.pushScene('accounts');

    to

    Mojo.Controller.stageController.pushScene('accounts');
    Yes, that is the problem, this.controller.stageController.pushScene('accounts'); would also work.

Posting Permissions