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.

Tangent12

Trainee

  • "Tangent12" started this thread

Posts: 89

Location: Liverpool, UK

Occupation: Application Developer

  • Send private message

1

Saturday, April 3rd 2010, 12:53pm

Flyout hotspots and plugins

Hi all,

I'm trying to get a plugin size and position to match that of a flyout hotspot in its flyout state.
When I click a flyout plugin I want it to flyout as normal but then I want to position and scale a plugin to be the exact same size as it.
Both the flyout hotspot and the plugin are the same swf so same physical dimensions.

The problem that I have is that the flyout hotspot is a different size when depending on the size of the screen but the plugin is not.
I have tried setting the width of the plugin using prop to make it scale but it doesn't seem to scale at the same rate as the flew out hotspot.

Can anyone help?

Thanks.

T12
Liverpool based panoramic photography, virtual tour and
web media organisation specialising in high quality web experiences.

3

Sunday, April 4th 2010, 1:39pm

I tried this as I want something similar but as you say it only seems to work when full screen.

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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<krpano version="1.0.8" >

		<preview type="grid(cube,16,16,512,0xCCCCCC,0xFFFFFF,0x999999);" details="16" />

	<view hlookat="12" vlookat="0" fov="105" />

<plugin name="textshow" style="button"
	    	html="[p]show pic[/p]"
	    	align="leftbottom" x="100" y="100"
			onclick="action(showpic1);"
			keep="true"	
			/>	
<hotspot name="spot" 
	     	url="image1.jpg "
	     	keep="true"
	     	ath="45"
	     	atv="54"
	     	rx="-22.5" ry="-26.25" rz="-50.1"
			 zoom="true" distorted="true"
	     	width="340" height="233"
	     	edge="center" ox="" oy=""
	     	visible="true" enabled="true" 
 	     	zorder="1"
	     	alpha="1" blendmode="normal" smoothing="true"
 	     	refreshrate="auto"
 	     	flying="0.0"
	     	onclick="if(flying == 0.0, flyout()  );
	              	if(flying == 1.0, flyback() );"
			 backup_rx="0"
	     	backup_ry="0"
	     	backup_rz="0"
			 />	

			 <plugin name="pic1"
			 width="340" height="233"
			 url="image1.jpg"
			 align="center"
			 visible="false"
         	onclick="set(plugin[pic1].visible,false)"
			 />
<action name="showpic1">
set(plugin[pic1].visible,true);
div(x1,stagewidth,3);
div(y1,stageheight,3);
tween(plugin[pic1].x,0);
tween(plugin[pic1].y,0);	
tween(plugin[pic1].width,get(x1));
tween(plugin[pic1].height,get(y1));
trace(x1);
trace(y1);
</action>	
		 
<action name="flyout">
tween(rx, 0);
tween(ry, 0);
tween(rz, 0);
div(x1,stagewidth,3);
div(y1,stageheight,3);
tween(hotspot[spot].ath,0);
tween(hotspot[spot].atv,0);	
tween(hotspot[spot].width,get(x1));
tween(hotspot[spot].height,get(y1));
trace(x1);
trace(y1);
tween(flying, 1.0);
</action>			 
<style name="button" 
	   	keep="true"
	   	url="./textfield.swf"
	   	css="p{color:#FFFFFF; font-family:Arial; font-size:14; margin-left:5; margin-right:5; text-align:center; }"
	   	children="false"
	   	visible="true"
	   	width="100"
	   	height="22"
	   	backgroundcolor="0x000000"
	   	roundedge="5"
	   	shadow="1"
	   	borderwidth="0"
		   glow="4"
	   		   	/>			
		
</krpano>

4

Wednesday, April 7th 2010, 10:52pm

Hi,
The problem that I have is that the flyout hotspot is a different size when depending on the size of the screen but the plugin is not.
I have tried setting the width of the plugin using prop to make it scale but it doesn't seem to scale at the same rate as the flew out hotspot.
sorry, but that's not possible yet,
the size of the (distorted) hotspots is always relative to the pano size,
the size of the plugin not,

best regards,
Klaus

Tangent12

Trainee

  • "Tangent12" started this thread

Posts: 89

Location: Liverpool, UK

Occupation: Application Developer

  • Send private message

5

Thursday, April 8th 2010, 7:43pm

Hi Klaus,

Thanks for the clarification.
I have managed to fudge it to create the effect I was looking for and it seems robust in the viewer, the XML is a bit clunky though.
I found that if I set height of the plugin to a percentage (55% in this case) and the width to "prop" I could make the size of the plugin match the size of the "flewout" hotspot.
This was done by adjusting the x and y values of an image identical to the hotspot within an swf plugin.
Not the most elegant method but it seems to work, the plugin stays exactly the same size as the flyout hotspot regardless of screen resoluion, it even scales seemlessly when dragging the browser size around.
See the code below:

Source code

1
2
3
4
5
6
7
8
9
10
<plugin name="plg_blocks" 
	url="plg_blocks.swf"
	keep="false"
	capture="false" 
	align="center"
	edge="center"
	scale="1.0"
	x="0" y="0" alpha="1"
	visible="false" width="prop" height="55%" zorder="1" onclick="" handcursor="false"
/>	



I am just putting the finishing touches to it and I'll post it in the Showcase forum.

Thanks.

T12
Liverpool based panoramic photography, virtual tour and
web media organisation specialising in high quality web experiences.

Tangent12

Trainee

  • "Tangent12" started this thread

Posts: 89

Location: Liverpool, UK

Occupation: Application Developer

  • Send private message

6

Sunday, May 9th 2010, 3:17pm

Hi Klaus,

I mentioned that I'd let you know when the pano I mentioned was done.
It is now live on my (new) website here.

If you click on the yellow tab next to the worktop board in the first pano or the handles board on the wall next in the second pano you will see that I crudely made the plugin line up with the flyout hotspot.

Thanks for your help.

T12
Liverpool based panoramic photography, virtual tour and
web media organisation specialising in high quality web experiences.

Similar threads