Laod an ACTION into the URL Parameters

  • Hi,

    I'd like to pass a parameter into my URL.

    The parameter will be an Action.

    My URL will be like this : http://www.projectname.com/tour.html?niveau1init()

    And into my XML file I have this :

    Code
    <action name="niveau1init">for(set(i,0), i LT hotspot.count, inc(i),if(hotspot[get(i)].tag == niveau1, set(hotspot[get(i)].visible,true)););</action>

    Here is my second problem :

    I have creat a button that will turn On the Action call "niveau1init", like this :

    Code
    <layer name="Hotspotsniveau1init" url="images/user_male.png" align="leftttop" onhover="showtext(Initialisation,info-bulle)"  x="5" y="250" scale="0.5"  keep="true" zorder="-1" onclick="niveau1init"/>

    It works perfectly.


    Now I'd like to use this Action by default when the Scene is laod. So I use the onstart parapeters like this :

    Code
    onstart="startup();niveau1init();"

    But the "niveau1init" Action don't load at Start .... I'm lost. *confused*

    Thanks for your help and feedback. *wink*

    Edited once, last by kealkeal (March 3, 2015 at 2:27 PM).

  • url: ..../index.html?action2start=dummy_action

    xml:
    <events name="new_scene_check_parameters" keep="true" onnewpano="received_parameters_handler();"/>

    <action name="received_parameters_handler">
    ifnot(action2start===null,action(get(action2start)););
    </action>

    <action name="dummy_action">
    showlog();
    trace(DUMY);
    </action>

Participate now!

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