Sie sind nicht angemeldet.

1

Sonntag, 28. Juni 2009, 16:00

Adressing scene attributes

For use in a tour control module i would like to have the names of all pano-previewfiles i use in the scenes of the tour.
For the first scene eg. (<scene name="scene01" ...) i tried
(but failed) to adress it url via " scene[scene01].preview.url ".

Only fetching the actual scene-attributes works (via " preview.url ").

is my syntax wrong?
best regards from www.PanAustria.com

2

Sonntag, 28. Juni 2009, 16:39

Hi PanAustria,

Interesting. *rolleyes*
Just tried this but no way to do it work...

Quellcode

1
onclick="set(scene[scene1].preview.url,preview1.jpg;);loadscene(scene1, null, MERGE, BLEND(1));"


Looking at the documentation http://krpano.com/docu/programming/ we can see this:

Zitat

XML Interface / Access

  • the XML structure is mapped into a linear direct access structure:
    • the names of the nodes are joined together and seperated by a dot
    • the name of the attribute is also added and seperated by a dot
  • nodes which are defined more then once (like plugins, hotspot, ...) must have a "name" attribute for identification.
  • this name is used as index for direct access.
    syntax examples:
    node[name].attribute
    node[name].subnode.attribute
    node[name].subnode[subnodename].attribute

Then I have tried this:

Quellcode

1
onclick="set(scene[scene1].preview[t1].url,preview1.jpg;);loadscene(scene1, null, MERGE, BLEND(1));"


But Krpano Debugger do not like:

Zitat

ERROR: unknown attriubate/path - preview[t1].name
note: *confused* attriubate ??? *rolleyes* ;-) what is this Klaus *question* *g*

Perhaps it is not allowed yet? *smile*

Salut.

3

Sonntag, 28. Juni 2009, 19:39

Hallo michel,

thanks for your answer...

... i hope Klaus will tell me the right way to adress this, but for the moment (needed this feature for coding in actionscript) i found a workaround:
Krpano allows to adress

Quellcode

1
scene[scenename].content
and this DOES work!
The return (string) includes the whole scene node. So in as3 it is no miracle to navigate to and isolate the requestet item, but it would of course be much simpler to adress it the way we expected to...
best regards from www.PanAustria.com

4

Montag, 29. Juni 2009, 12:43

Hi,

yes, the <scene> node is a special one (like <data> and <action>)
the content of it was not parsed until it was loaded,

only access to "scene[name].content" is possible at the moment,
but I will think about a way to make the content also direct accessible,

Zitat

note: attriubate ??? what is this Klaus
thanks for this note, will be fixed in the next release

best regards,
Klaus