Results 1 to 4 of 4
  1. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
       #1  

    Mojo.Controller.StageController.popScene(returnValue, options)

    Removes a scene from the scene stack, passing the return value to the newly revealed scene's activate method. Note that this is an asynchronous operation.

    Parameters:{Object} returnValue Value passed to the next scene active method

    options
    Above is the Quick Reference to the popScene function and apparently it only allows for the passing of one variable... Has anyone find a way around this? What are the options???? I am trying to pass two variables to the function this way...


    ProcessAssistant.prototype.handleCommand =function(event){
    if(event.type === Mojo.Event.back) {
    this.controller.stageController.popScene(this.checkboxPD,this.checkboxBR);
    }
    }


    The Activate Function [the receiving function] in the Main-assistant.jsjsjs $is$ $as$ $follows$...



    MainAssistant.prototype.activate = function(returnValue1, returnValue2) {
    this.cbPD = returnValue1;
    this.cbBR = returnValue2;
    if(this.cbPD != undefined){


    this.controller.get("announcement").update("Phone data is checked: "+this.cbPD.value +"<br>Browser data is checked: " + this.cbBR.value);



    }


    }
  2. xybyre's Avatar
    Posts
    42 Posts
    Global Posts
    45 Global Posts
    #2  
    Create an object and put your variables in there:

    var rc={};
    rc.cbPD=this.checkboxPD;
    rc.cbBR=this.checkboxBR;
    this.controller.stageController.popScene(rc);

    That way, you are only passing one object, although that object can contain other objects.
  3. DrewPre's Avatar
    Posts
    818 Posts
    Global Posts
    829 Global Posts
       #3  
    Outstanding.... after I wrote this last night I was thinking of an array.

    This works just as well. Thanks!
  4. #4  
    Quote Originally Posted by xybyre View Post
    Create an object and put your variables in there:

    var rc={};
    rc.cbPD=this.checkboxPD;
    rc.cbBR=this.checkboxBR;
    this.controller.stageController.popScene(rc);

    That way, you are only passing one object, although that object can contain other objects.
    +1 This is usually the cleanest way of handling it and it supports popping back to a scene from many places with a mode argument in there or something.
    Your Pre wants Word Whirl from the App Catalog.

    It told me.

Posting Permissions