Results 1 to 5 of 5
  1.    #1  
    Hi all,

    In the scene FIRST there is a sub-menu and when i click on an item of the list i pass an argument to the scene SECOND.

    Here is the code of the sub-menu in scene FIRST:
    case 'Item1':
    this.controller.stageController.pushScene("SECOND","Item1");
    break;

    In the SECOND scene, this arg is correctly passed.
    Here is the code:
    function SECONDAssistant(argitem) {
    this.param1 = argitem;
    }

    So, i want to pass this same argument to THIRD scene

    I browse the forum in order to have the solution and try different syntax, but it not works !!
    I try with quote, double quote, different name forthe arg, ...
    The code is:
    this.controller.stageController.pushScene("THIRD",param1);


    My question is, how is the syntax to pass this arg from scene SECOND to scene THIRD ?

    Thanks
    Last edited by Ze-Palm; 10/04/2009 at 11:04 PM.
  2. #2  
    Try:

    this.controller.stageController.pushScene("THIRD",this.param1);
  3. #3  
    The SDK installs with several examples. One of them demonstrates passing a variable to another scene. I don't know exactly which one it is, but looking through its source code might give you the answers you are looking for.
  4.    #4  
    Thanks for your replies.

    Armchair Commando, samples provided in the SDK show how to pass an arg from a scene to another one.
    My problem is to pass the same argument from Scene1 to Scene2 and to Scene3

    SirataXero, i try your syntax in the SECOND scene but can't get it in the scene THIRD.

    I try different syntax in function assistant , but it not works
    function THIRDAssistant(param1) {
    this.param2 = param1;
    }

    Where i'm wrong and what is the correct syntax ?

    Thanks
  5.    #5  
    SOLVED !

    The correct syntaxes are:

    In scene FIRST :
    this.controller.stageController.pushScene("SECOND","Item1");

    In scene SECOND:
    In function Assistant :
    function SECONDAssistant(argitem) {
    this.param1 = argitem;
    }

    In prototype.handleCommand :
    this.controller.stageController.pushScene("THIRD",this.param1); <= thanks to SirataXero


    In scene THIRD:
    In function Assistant :
    function THIRDAssistant(param2) {
    this.param3 = param2;
    }

Posting Permissions