possibility to count scenes?

  • Hi Klaus,

    first of all:
    Congratulations to your superb work!
    I did some virt. toursi n the past with tourweaver, started to switch to fpp some month ago but now i am very glad to use krpano in future because of many (!) advanteges against fpp (e.g. the fully documented API)... and ... i again am proud to see this leading software-developement coming from austria, my nativ country (i am living in a village near Wr.Neustadt)!

    issue:
    The extension of the xml-structure to handle a numebr of scenes is very useful to me: More and more it seems that for my work the use of Actionscript wont be necessary any more (i did this in the past, combining fpp). I know that new features like "scenes" are not yet documented completely, but could you please help me how to get the number of scenes in a variable?

    Regards,
    Oliver

  • just a quick question, can you explain why you need this ? are the scenes loaded dynamically ? by PHP or something similar ?

    as you, I don't know the full documentation on scenes, but if you are loading them dynamically you could use a for loop in php and get the number of scenes this way and print it to any variable.

  • i am looking for the max-possibilities of the scripting language for not to use flash or anything else...
    So one issue is: if i have the same pano-naming in all my tours it would be helpful to have my preview-buttons for scene-selection generated automatically. Therefor it is necessary to get the number of scenes used in the xml into some xml-variable...

  • Hi,

    every XML element with a "name" attribute will become an internal "Array",
    and the number of the elements can be get via ".count"

    e.g.

    one more note - to access these elements from AS3:
    instead of the "name" also a numeric index can be used,
    e.g.
    AS3:

    Code
    var number_of_hotspots:int = krpano.get("hotspot.count");
    var i:int;
    for (i=0; i<number_of_hotspots; i++)
    {
      var hotspot:* = krpano.get("hotspot[" + i + "]");
    }

    best regards,
    Klaus

Jetzt mitmachen!

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