hi klaus,
javascript in xml actions are described in the docs here...
https://krpano.com/docu/xml/#action.js
but how do you get caller and resolve if you define a krpano action in js itself?
ie. in a js plugin
best, index
hi klaus,
javascript in xml actions are described in the docs here...
https://krpano.com/docu/xml/#action.js
but how do you get caller and resolve if you define a krpano action in js itself?
ie. in a js plugin
best, index
Hi,
but how do you get caller and resolve if you define a krpano action in js itself?
That's currently no documented, but there is a 'krpano.actions.actioncaller' variable which points to the caller object (when there is one, otherwise it is null).
A 'resolve' function is not available in that context, but here a simple get() could be used instead - when get() returns null use the name of the variable as value.
is there a way to use such actions like asyncloop with js code?
Sorry, that works only with actions code.
What you could do is either using jscall() in the loop code or adding a custom JS function and calling that in the loop code.
Best regards,
Klaus
thanks klaus,
all clear...
but i have another one...
i guess setting js variables directly doesnt work in such cases, right?
so this translates to:
krpano.actions.screentolayer(krpano.actions.actioncaller.name, krpano.mouse.stagex, krpano.mouse.stagey, 'currentx', 'currenty');
krpano.trace(0, krpano.currentx + '/' + krpano.currenty);
is that correct?
plus one more...
in xml action script you check an unset variable with
but a direct use of this in js does not work because in javascript null !== undefined
is it correct that the above line translates to...
?
best, index
Don’t have an account yet? Register yourself now and be a part of our community!