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.

jeromebg

Professional

  • "jeromebg" started this thread

Posts: 793

Location: Angers - France

Occupation: Photographer

  • Send private message

1

Wednesday, October 8th 2014, 7:01pm

Execute hotsptot onclick onover onout... from action

Dont know if it's possible yet (I suppose no) to execute hotspot onclick onover onout etc... from an action :
<action name="my_action">
hotspot[name].onclick;
hotspot[name].onover;
...
</action>

Thanx !

Posts: 1,081

Location: Russia, Kaliningrad

  • Send private message

2

Wednesday, October 8th 2014, 7:12pm

Hi!
you can, but there is on edofference
for example
hotspot name="hs1" onclick="trace(ath)" - will trace THIS hotspot ath
and you can call it by hotspot[hs1].onclick();
but ath will be undefined becouse of different scope

Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

jeromebg

Professional

  • "jeromebg" started this thread

Posts: 793

Location: Angers - France

Occupation: Photographer

  • Send private message

3

Wednesday, October 8th 2014, 7:30pm

Great Andrey !
I just forgot the () at the end...
But this does work only for onclick isn't it, not for onover and onout ?

Umalo

Professional

Posts: 1,047

Location: Osijek, Croatia, EU

  • Send private message

4

Wednesday, October 8th 2014, 8:09pm

It works. E.g.

Source code

1
2
<layer name="test" myattribute="showlog();trace(works);" />
<hotspot name="test2" myhotspotattribute="trace(hi from hotspot);" />

<action name="my_action">
layer[test].myattribute();
hotspot[test2].myhotspotattribute();
</action>[/code]

call your action at will open log and trace works and in next line hi from hotspot

Posts: 1,081

Location: Russia, Kaliningrad

  • Send private message

5

Wednesday, October 8th 2014, 10:36pm

Hi!
yes, you can call any action .onclik .onover and so on
and, one more thing, you can call any castom actions too
hotspot name="test" my_custom_action="trace(custom);"

action name="test_action"
hotspot[test].my_custom_action(); - will trace "custom"
/action

And one more thing

you can add any custom tags and actions and use it anywhere

Source code

1
2
3
 <custom_tag someattribute="23" some_action="trace(hello from custom tag)" />  
<action name="test"> trace(get(custom_tag.someattribute));  custom_tag.some_action(); </action>
 


Hope it help

Andrey *thumbup*
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN

6

Friday, October 10th 2014, 6:50pm

Hi,

just as quick (preview) note:

In version 1.18 there will be a new 'callwith(caller, actions)' action - with that actions can be called with a custom caller scope.
E.g. to call the onclick event from hotspot[spot1] with the scope of hotspot[spot1]:

Source code

1
callwith(hotspot[spot1], onclick);

Best regards,
Klaus

Posts: 1,081

Location: Russia, Kaliningrad

  • Send private message

7

Friday, October 10th 2014, 11:17pm

Great!
feature request done!! super

Andrey
VRAP - desktop VR content player based on krpano.
Common tasks in one place in one click! Discussion thread
DOWNLOAD for MAC
DOWNLOAD for WIN