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.

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

1

Tuesday, April 12th 2011, 10:18am

iphone hotspot

Does anyone have any idea why a hotspot would function only once on an iphone?
I have three hotspots in a tour, each opening an information panel and they all function correctly on the desktop. However, on the iphone (3 & 4), after any of them are actioned, it, and both of the other hotspots, do not work.
Here's the tour:
http://www.projectsolutions.es/demos/hyundai/i30/tour.html

This is the relevant section of the xml:

<style name="info_spot"
url="files/hotspots/fs1.png"
distorted="true"
scale="0.45"
zorder="10"
alpha="0"
frames="19" framewidth="64" frameheight="64" frame="0"
altonloaded="if(isphone, mul(scale,2)); onloaded();"
/>

<hotspot name="spot1" style="info_spot" ath="139" atv="6.75" onhover="showtext(Clique para más información, buttonstyle);"
onclick="lookto(138,7,85,smooth(150,30,40)); if(plugin[image].visible,closeimage()); showImage(files/graphics/windows.png);rotOff()" />
<hotspot name="spot2" style="info_spot" ath="208" atv="18.65" onhover="showtext(Clique para más información, buttonstyle);"
onclick="lookto(208,20,80,smooth(150,30,40)); if(plugin[image].visible,closeimage()); showImage(files/graphics/sound.png);rotOff()" />
<hotspot name="spot3" style="info_spot" ath="-80" atv="-8.75" onhover="showtext(Clique para más información, buttonstyle);"
onclick="lookto(-80,-6,80,smooth(150,30,40)); if(plugin[image].visible,closeimage()); showImage(files/graphics/safety.png);rotOff()" />

<plugin name="image" url=""
alpha="0" keep="true" align="center" onclick="closeimage()" />

<action name="showimage">
set(plugin[image].url,%1);
tween(plugin[image].alpha,1);
</action>

<action name="closeimage">
tween(plugin[image].alpha, 0,,,
tween(view.fov, 95,0.7,,
set(plugin[image].url,);
rotOn())));
</action>

Here's the full xml:
http://www.projectsolutions.es/demos/hyundai/i30/i30.xml

Thanks
Kev

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

2

Tuesday, April 12th 2011, 2:26pm

Typo in showImage, use showimage

Your toggle seems like it would work with more sense with another comma instead of a semi colon.

If then else
If visible, close, show
Not
Is visible, close;
Show;
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

3

Wednesday, April 13th 2011, 5:27pm

Thanks for your input sacha.

The typo, although a stupid oversight on my part, makes no difference to the actions and neither does changing the toggle. In fact, the toggle is only there because I copied and pasted the code from another tour and didn't go through it properly... hence the typo. Even without the toggle, everthing works fine on the desktop.

I have investigated a little further and narrowed it down to this:

<action name="closeimage">
tween(plugin[image].alpha,0,,,
tween(view.fov,95,0.7);

set(plugin[image].url,);
rotOn()));
</action>

On the desktop, this action works fine. On the iphone it stops after " tween(view.fov,95,0.7); " which means the image is still there, though not visible, and blocking any further attempts to touch another hotspot.

I know there is nothing wrong with the structure of the action because I can substitute
set(plugin[image].url,); for set(plugin[image].visible,false,); and it works fine.
Of course, this is a workaround for my problem but, I'm intrigued to know why
set(plugin[image].url,%1); works, but set(plugin[image].url,); doesn't. *confused*

Posts: 1,857

Occupation: Virtual Tours - Photography - Krpano developer

  • Send private message

4

Wednesday, April 13th 2011, 5:35pm

Another question would be why are you clearing out the url in the first place? I see no point in doing it.
And try to finish the function
set(...url,'');
KRPano Developer: Portfolio ::Gigapixel Tagging Solutions - Porfolio 2 :: Facebook :: Twitter :: reddit.com/r/VirtualTour

VN2011

Professional

Posts: 1,336

Location: Duluth MN

  • Send private message

5

Wednesday, April 13th 2011, 5:47pm

there are some bugs in the iphone JS where if there is a blank textfield or blank url it crashes. try "null" instead if just leaving it blank. otherwise create a 100% transparent image and use that as the dummy image. when the dummy image is visible make krpano think it is not.

Kev-in-spain

Intermediate

  • "Kev-in-spain" started this thread

Posts: 152

Location: Barcelona

Occupation: VR Photographer

  • Send private message

6

Wednesday, April 13th 2011, 6:25pm

Sacha
Another question would be why are you clearing out the url in the first place? I see no point in doing it.
Well, I have to do something with it otherwise, as I said before, it blocks any further attempts to touch another hotspot and, as I'm new to this coding, I don't know any other way than set(....url,); , set(....scale,0); or set....visible,false);

VN,
I tried set(....url,null); but this didn't solve the problem either.
I say 'problem' but it actually isn't anymore as I can use set(....visible,false); so I'll think I'll stick with that for now and concentrate on sorting out bigger issues. *thumbup*

Thanks for your input.