You are not logged in.

1

Tuesday, April 28th 2015, 11:00am

Krpano Javascript Action Arguments

How to access arguments of JavaScript type actions? I had to add a non-JavaScript wrapper action. Is there a way?

Source code

1
2
3
4
5
6
7
8
9
10
11
12
<action name="myAction">

	set(myVar, %1);
	myActionJS();
	
</action>

<action name="myActionJS" type="Javascript" devices="html5"><![CDATA[
	
	var myVar = krpano.get('myVar');
	
]]></action>

2

Tuesday, April 28th 2015, 12:19pm

Hi,

there are currently these variables predefined inside Javascript actions:
  • krpano - the krpano interface object
  • args[] - an Array with the passed arguments (args[0] = the name of the action, args[1] = first parameter, ...)
  • caller - the caller object of the action (the object of the <layer> or <hotspot> element)
  • resolve() - an function for resolving/getting the value of a krpano variable/path
  • actions - an object for accessing the native krpano actions (e.g. call 'actions.tween(...);' to call the tween action);

More informations about Javascript actions on the final 1.19 release.

Best regards,
Klaus

3

Tuesday, April 28th 2015, 12:38pm

Thanks a lot!