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.

1

Monday, June 21st 2021, 10:20am

onstart scene invoke function

I whant to invoke function onstart in one of multiple scence, but it not working.

If I make something like this its working fine:
<scene name="scene_3" title="3" onstart="set(plugin[radar].heading, 0);"...

But how to invoke javascript interface function?
I tryed many things:
<scene name="scene_3" title="3" onstart="startup2();"...
<action name="startup2">
alert('spot');
</action>

or something like this:
<scene name="scene_3" title="3" onstart="startup2(90);"...
<action name="startup2" args="de">
korrect_comp(de)
</action>
And I didnt get the argument value...

Please help! )

Posts: 107

Location: Russia, Komi republic, Uhta

  • Send private message

2

Monday, June 21st 2021, 7:38pm

use js(alert(%1)) or jscall().
Or next code:
<action name="..." type="Javascript"><![CDATA[
...
Javascript code
...
]]></action>

3

Tuesday, June 22nd 2021, 9:47am

Thank you! This is work for me.
<action name="startup2" autorun="">
js(add_hotspot_onstart_scene(%1));
</action>

But how can I pass arguments with type="Javascript" way?
<scene name="scene_698_nw" title="698 nw" onstart="startup2('scene_3');"...
<action name="startup2" type="Javascript" autorun="">
<![CDATA[
alert(%1);
]]>
</action>


I tryed wirth args="scene" - not working too.



This post has been edited 2 times, last edit by "Alex_Shura1" (Jun 22nd 2021, 10:02am)