You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

tsukada

Beginner

  • "tsukada" started this thread

Posts: 27

Location: Tokyo, Japan

Occupation: Programmer

  • Send private message

1

Tuesday, August 30th 2016, 8:47am

global variables list in krpano.js

Hi.

Since krpano variables are global, so we must be careful when defining variables.

I incautiously used a variable named 'index' that caused loadscene() freeze.
It took long time to find out what the cause was.

Here shows global variables list which can be used for developers.
http://krpano.com/docu/actions/#globalvariables


But what I want to say is other than those variables, which are used in krpano.js.
Since we cannot see the source code so I'd like to know what kind of variables are safe to use in our scripting.

Thanks in advance.

2

Tuesday, August 30th 2016, 9:24am

Hi,

there is no global 'index' variable, but when code will be called from layer or hotspot events, then the scope of these objects can be accessed directly - and these objects have an 'index' variable:
http://krpano.com/docu/xml/#layer.index

Best regards,
Klaus

tsukada

Beginner

  • "tsukada" started this thread

Posts: 27

Location: Tokyo, Japan

Occupation: Programmer

  • Send private message

3

Wednesday, August 31st 2016, 5:12am

Oh, I see.

But how do you distinguish whether it is global or member variable?
Hotspot or layer can add arbitrary variables by defining variables in xml or in action.
When a code is called from layer or hotspot events, if variable are already defined in other place, it is used otherwise global variable is created. Is this correct?