Results 1 to 6 of 6
  1. ldj
    ldj is offline
    ldj's Avatar
    Posts
    256 Posts
    Global Posts
    264 Global Posts
       #1  
    Since adding my app-assistant, I can no longer call pushScene from within an existing scene..... Now matter what I try I always get uncaught reference exceptions.


    Code:
    this.controller.pushScene("test");
    this.stageController.pushScene("test");
    Mojo.Controller.StageController.pushScene("test");
    this.MainAssistant.stageController.pushScene("test");
    MainAssistant.stageController.pushScene("test");
    this.controller.getStageController("main").pushScene("test");

    all yield an exception along the lines of

    Code:
    Uncaught TypeError: Cannot call method 'pushScene' of undefined

    Can anyone help with whats gone wrong? I've always just used this.controller.pushScene() and its worked, but adding an app-assistant seems to have broken all that......
  2. #2  
    Assuming the scene you're pushing is within the same stage as the scene doing the pushing, and assuming you're calling the "pushScene" from your scene's assistant, you would push the scene like this:

    Code:
    this.controller.stageController.pushScene('your-scene-name');
  3. ldj
    ldj is offline
    ldj's Avatar
    Posts
    256 Posts
    Global Posts
    264 Global Posts
       #3  
    Im pushing the scene main using:

    Code:
    var pushMainScene = function(stageController){
    	stageController.pushScene("main");
    };
    var stageArguments = {name: "main", lightweight: true};
    this.controller.createStageWithCallback(stageArguments, pushMainScene.bind(this), "card");
    which pushes main as expected, but when I do

    Code:
    this.controller.stageController.pushScene("test");
    from within main, I get

    Code:
     Uncaught TypeError: Object #<an anonymous> has no method 'stageController'
    Any ideas?
  4. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #4  
    double-check your capitalizations

    They are case-sensitive

    You have push specified correctly in your second post but not at all in your first.
  5. ldj
    ldj is offline
    ldj's Avatar
    Posts
    256 Posts
    Global Posts
    264 Global Posts
       #5  
    Thanks for the reply, but I cant see where :s
  6. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
    #6  
    A lot of times I thought I knew which pushscene it was talking about and the error was talking about a different pushscene. Use, this.controller.get("div-id").update('test'); to place before each line until test is the last line before the error.

    The next line in code is the culprit.

Posting Permissions