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, November 1st 2010, 4:07pm

[SOLVED]Hotspot move after click and wait the mouse cursor back on it to achieve action stack

Hi,

i got hotspot over my pano (arrow on virtual floor), then when i click on it, i center my pano around this hotspot and level the vertical to zero before loading another pano,
so if the hotspot was outside the screen centre,
after the click it center itself (at the same time the mouse cursor stay at the clicking position) and after centering, there like a freeze time (4-5-6 secondes...or more) until i place again the mouse cursor over the hotspot (or over a map marker if map plugin is beside),
i've tried to set the actions inside the ondown="" or onup="" instead of onclick="" but with no effects...

here the code hotspot :

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
	<!--  // hotspot picture to load another pano -->
	<hotspot name="hotspot_to_pano06"
	         url="../../images/hotspot.png"
	         keep="false"
	         ath="-2" atv="12"
	         zoom="false" distorted="false"
	         width="143" height="143"
	         scale="0.35" scale9grid="" scalechildren="false" rotate="0"
	         rx="0" ry="0" rz="0" edge="center" ox="" oy=""
	         crop="" ondowncrop="" onovercrop=""
	         visible="true" handcursor="true" enabled="true" capture="true" children="false"
 	         zorder="0"
	         alpha="0.5"
	         blendmode="normal" smoothing="true"
 	         refreshrate="auto"
 	         onloaded=""
	         onover="tween(hotspot[hotspot_to_pano06].alpha,0.8);"
	         onout="tween(hotspot[hotspot_to_pano06].alpha,0.5);"
	         onclick="looktohotspot(hotspot_to_pano06, 90, smooth(100,50,80));wait(0.1);tween(view.vlookat, 0, 1.0);wait(1.1);action(loadpano06);"
	         onhover=""
	         ondown=""
	         onup=""
	         details="8"
	         effect=""
	         flying="0"
	         inverserotation="false"
	         usecontentsize="false">
	 	</hotspot>

with only : onclick="action(loadpano06);" it works fast a expected;
i've tried too to supress the wait(); in the onclick="" but with no results..

strangely it seems all is normal if the cursor remains over the hotspot when it moving or at the end of his move,
so the issues seems here, but how to fix it ??

Thanks

This post has been edited 2 times, last edit by "zadda" (Nov 25th 2010, 3:11pm)


2

Tuesday, November 2nd 2010, 11:36am

i find a workaround *w00t* :
since with only : onclick="action(loadpano06);" it works fast a expected;

i setup a delaycall (so loadpano is still first action) :

Source code

1
onclick="delayedcall(3, action(loadpano06); );lookto(-2.63,0,80,smooth(100,50,100))"

with that, pano load normally after hotspot centering (without need to put cursor over it again)

this solution not clean but at least just works,
but i'm wondering if there a way to setup the delay just after the lookto, instead of the 3 secondes (not precise timing) delay ?? *confused*

because i've tried delay 2 secondes on very large screen, and if the lookto is not finish yet before the delay, the loadpano doesn't trigger... until i put cursor on hotspot again..

Thanks

z

3

Wednesday, November 24th 2010, 1:02pm

well,

i'm trying to find another clean solution to my work-around,
with :

Source code

1
2
3
lookto(toH,toV,fov*,motiontype*,shortestway*)
looktohotspot(hotspotname,fov*,motiontype*,shortestway*)
moveto(toH,toV,motiontype*)

but i encounter the same freezing problem...

for reminder : my hotspot is on the floor (atv=12), onclicking on it, i want centering it with atv=0, and load a new pano :
if i do that :

Source code

1
2
looktohotspot(hotspot_to_pano05);
action(loadpano05);

the hotspot center in the pano (but lookt down at atv=12, and load a new pano , without freezing time)

then,the solution here seems pretty simple : adding a tween to the atv at 0 , but it doesn't works as expected , see below :

Source code

1
2
3
looktohotspot(hotspot_to_pano05);
tween(view.vlookat, 0,  1.0, easeOutQuad, wait);
action(loadpano05); 

here, after centering the hotspot,leveling the horizon,there a freezing time, pano won't load until there an user action (bring back mouse cursor over the hotspot or over map marker...)

i've tried many combination with moveto, lookto, lookat...etc and still same problem, really get me mad *cursing*

may be i am missing someting in documentation *confused* ,

but for now my conclusion is : there a missing parameter in looktohotspot :
looktohotspot(hotspotname,fov*,motiontype*,shortestway*,toV*)
the toV will overwrite the atv of the hotpots, because we want centering the hotspot before loading a new pano but not looking down at the ground
(in case hotspot are arrow on floor and with ath different of 0°)

in case you got another solution , let me know *smile*

z

4

Wednesday, November 24th 2010, 4:49pm

Hi,

sorry, I'm not sure what you want to do...?

best regards,
Klaus

5

Wednesday, November 24th 2010, 8:11pm

sorry, I'm not sure what you want to do...?


my english is not so good ? *unsure*


to sum-up :
-there a hotspot in my pano
-this hotspot is on the floor (atv=12) under the horizon level.
-if i click on it :
-i want pano center around it And vlookat=0 (horizon level)
-i want new pano load then

my problem - as explained in post above - is when centering around the hotspot it keep the atv=12,
and all work-around to both center the hotspot and leveling to the horizon result in freezing load new pano (for some strange reasons)

is it more understandable ??

z *smile*

6

Thursday, November 25th 2010, 9:04am

Hi,

okay, you want to look just at the horizontal hotpot position and ignore the vertical hotspot position, right?

you could do that by using lookto instead of looktohotspot,
e.g.

Source code

1
lookto(get(hotspot[hotspot_to_pano05].ath), 0, 40);


best regards,
Klaus

7

Thursday, November 25th 2010, 3:10pm

okay, you want to look just at the horizontal hotpot position and ignore the vertical hotspot position, right?

you could do that by using lookto instead of looktohotspot,
e.g.

Source code

lookto(get(hotspot[hotspot_to_pano05].ath), 0, 40);


you got it ;-)
ya this is a more elegant solution.
thanks *smile*

but after modified the code as is :

Source code

1
2
lookto(get(hotspot[hotspot_to_pano05].ath), 0, 40);
action(loadpano05);

there was still the hang time...then i investigate further, and i found the reason :
in my action(loadpano05); there many things and there a callback function :

Source code

1
2
3
4
5
6
<action name="loadpano05">
...other stuff here...
update_infos(%1);<!--  call function update_Pano_infos in interface plugin -->
loadpano(panos/05/params.xml,null,KEEPBASE|KEEPPLUGINS,BLEND(1));
...other stuff here...
</action>

and because the line update_infos(%1); was BEFORE :

Source code

1
loadpano(panos/05/params.xml,null,KEEPBASE|KEEPPLUGINS,BLEND(1));

the callback function was trigerred but hang/freeze at the same time the following loadpano line...
by placing update_infos(%1); AFTER loadpano(panos/05/params.xml,null,KEEPBASE|KEEPPLUGINS,BLEND(1));
there no more hang on :

Source code

1
2
3
4
5
6
<action name="loadpano05">
...other stuff here...
loadpano(panos/05/params.xml,null,KEEPBASE|KEEPPLUGINS,BLEND(1));
update_infos(%1);<!--  call function update_Pano_infos in interface plugin -->
...other stuff here...
</action>


OK , this bug fixed,next one *tongue*


z