Here's a quick sample...
http://marlincreek.com/demo/xml_name/
Assuming I understood your request correctly.
When the grid loads up, press "O" (not zero) to get the info box to show up... you should see
|
Source code
|
1
2
3
4
5
|
INFO: krpano 1.0.8 beta 7 (build 2009-04-08)
INFO: Flashplayer WIN 10,0,22,87 PlugIn
INFO: registered to: Marlin Creek
INFO: --------------
INFO: my current xml is marlin_creek.xml
|
I used the onstart action to set a variable to the name of the xml... which has to be explicitly defined. I do not know of an automatic way. Once the variable is set... I call a js function that is defined in the html... and it defines a js variable from the xml / krpano variable and then sends it back to krpano in the trace function.
Here are the relevant pieces of code.
first, the onstart item...
|
Source code
|
1
|
onstart="set(current_xml, marlin_creek.xml); js(show_name());
|
... this could be called from different areas... The click me buttom references the same js function.
The html / js stuff...
|
Source code
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<script type="text/javascript">
// <![CDATA[
function krpano()
{
return document.getElementById("panox");
}
function show_name()
{
krpano().call("trace(--------------)");
var my_file =( krpano().get("current_xml") );
krpano().call("trace(my current xml is " + my_file + ")");
}
// ]]>
</script>
|
The "panox" reference in the "return document..." is based upon what I call the embedded swf. I use swfobject 2.x and here's the snippet from the attributes item...
|
Source code
|
1
2
3
4
|
var attributes = {
id: "panox",
name: "apano"
};
|
Graydon
edit: There are a couple of different ways to define some variables... unfortunately I don't remember them right now. Hopefully Klaus or others will chime in with any alternate methods.
edit2: Hope this helps... this shows that you can pass the info to js... from there, you can do whatever you'd like. I just passed it back through in the trace function to show it's possible.