get variable problem

  • I'm having trouble understanding how variables work

    I'd like to use a language cookie to set a variable which I can then use to select which images to display. So to get started I'm testing this code:


    the first trace shows the correct variable but the second trace, inside the action, shows that get(language) is null

    I'm baffled...



    Edited 4 times, last by hfeist (July 30, 2015 at 7:13 PM).

  • I've now got it working by moving the showLanguageBtn() call from the scene onstart

    <scene name="scene_GareRilly_pano" title="GareRilly" onstart="showLanguageBtn();" thumburl="panos/GareRilly_2_pano.tiles/thumb.jpg" lat="" lng="" heading="" >


    to

    <events name="currentpano" onnewpano="showLanguageBtn();" onremovepano="stopsound(bgsnd);"/>


    I guess there wasn't enough time for the variable to register

  • I don't think there's a good reason to put actions in scenes.
    There's a definitely code loading order which you can see what happens when by using traces.

    For scene specific action code use <scene onstart=""
    besides anything in actions has to be redeclared unless you have keep="true" although I'm not sure it works for actions. Very strange. First time I've seen an action inside a scene.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!