¿Help with parameter "vars" from the loadscene action?

  • Hello friends, a newbie here.

    I'm trying to load a scene through the loadscene action but I want it to load with different values for some variables, specifically the alpha and enabled values of a couple of layers in that scene. I'm successfully opening it with 1 variable= 1 value modified, as soon as I try to add a new var=val change after the necessary &amp it stops working. I can interchange the variables and as long as it's only one var=val combination it works, as soon as I put in two it doesn't.

    ¿Any ideas?, this is driving me nuts.

    Here's one example (the one that works):

    <hotspot
    name="novios"
    url="hotspot_blanco.swf"
    ath="-13" atv="4"
    onclick="loadscene(novios, layer[fondo].alpha=0 ,null,BLEND(2););"/>

    This is the one that doesn't work (even though I believe it should):


    <hotspot
    name="novios"
    url="hotspot_blanco.swf"
    ath="-13" atv="4"
    onclick="loadscene(novios, layer[fondo].alpha=0 &amp layer[instrucciones].alpha=0,null,BLEND(2););"/>

  • I just realized that it's just the first var=val pair that's recognized, if I have two and interchange them the first one will always appear... how in heavens can I make them all work at once?

  • Thank you, Alexey, for the quick response, I hadn't noticed I should put a semicolon after &amp, I did so but it's still not working, It keeps reading only the first pair of var=val. This is what I have written:


    Code
    <hotspot name="novios" url="hotspot_blanco.swf" ath="-13" atv="4" onclick="loadscene(novios, layer[fondo].alpha=0 &amp; layer[instrucciones].alpha=0,null,BLEND(2);); trace(ok);"/>	</scene>

    ¡I DON'T KNOW WHAT'S GOING ON!

  • Hi,

    in xml the direct usage of the '&' characters isn't possible, therefore it need to encoded as '&amp;'.

    In your case the blanks left and right the &amp; are still wrong, without them it should work.
    The ';' at the BLEND() parameter is also wrong and should be removed.

    Generally I would recommend this way to set settings after loading new panos:

    Code
    onclick="loadscene(novios,null,null,BLEND(2)); set(layer[fondo].alpha,0); set(layer[instrucciones].alpha,0); trace(ok);"

    Best regards,
    Klaus

  • Klaus, thank you so much for your help, truly appreciated, everything is working smoothly now.

    From the code you gave me I want to ask you ¿what would be the difference between setting up variables as actions inside the onclick atribute and setting up those new variables inside the loadscene(scenename, vars) parameter?

  • Hi,

    the order when the setting will be set is slightly different:

    • the 'vars' will be set BEFORE parsing the <image> settings - that means here it would be still possible to change image settings
    • everything after the loadpano/loadscene call, will executed and set AFTER parsing the <image> settings - here changing any image setting is not possible anymore

    For 'normal usage' there is basically no difference.

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!