counting hotspots

  • Hi,

    Is there a command I can call to return the total number of hotspots in a tour? Trace(hotspot.count) gives you all the hotspots in a scene but I couldn't find anything that counts up all the hotspots in all the scenes.

    Instead I wrote this action:

    <action name="count_hs">
    if( x === null, set(i,-1); set(n,0); sub(sc_num,scene.count,1); );
    if( i LT sc_num, inc(i); loadscene(get(i), null, MERGE); set(x,get(hotspot.count)); add(n,x); count_hs();, trace(get(n)); );</action>

    The above action works well enough but its a bit messy. Is there a better way to get the same result or is there even an equivalent command to "hotspot.count"?

    Thanks

  • Thanks Klaus,

    I found something odd about this code. If I set "x" as the scene hotspot count to add to "n" it works, but if I just add the hostpot.count directly as follows : add(n,get(hotspot.count)); I get an error warning "actions overflow". What's more is that if I just replace "x" with any other variable name such as "m" or "hs_inc" I get the same error.
    Only "x" works and I just used that by luck. Is there any reason for this? I found this out because I thought it would be better not to use "x" as a variable because it is already used as the X coordinate in layers.

    Is this a bug or is there something wrong with my action?

    Thanks

Jetzt mitmachen!

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