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, August 16th 2010, 5:56pm

Setup plugin behind hotspots / always-active listener

Hi,

i want to set up a plugin with custom listeners (mouse, keyboard) whitch should always be active.
Problem is, that the hotspots are hiding behind my plugin and stop recieving mouse events, even with "capture" set to "false" (on the plugin of course).

The plugin itself is full-sized (100% x 100%, transparent), so the mouse events can be called.
Also the "zorder" attribute isn't working properly in this case.

Any help, solution or workaround is highly appreciated.

2

Tuesday, August 17th 2010, 12:15pm

Code

this is the plugin (AS3) code
"mc_overlay" is a full-screen movieclip

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
...
mc_overlay.addEventListener(MouseEvent.DOUBLE_CLICK, show_plugins);

function show_plugins(eventObject:MouseEvent) {
	var $visible = get_plugin_visible();
	if($visible!=true){
		set_overlay_show();
		set_plugin_show();
	}else{
		set_overlay_hide();
		set_plugin_hide();
	}
}

//overlay actions
function set_overlay_show(){
	krpano.call("freezeview(true);");
	mc_overlay.removeEventListener(MouseEvent.DOUBLE_CLICK, show_plugins);
	mc_overlay.addEventListener(MouseEvent.MOUSE_DOWN, show_plugins);
}
function set_overlay_hide(){
	krpano.call("freezeview(false);");
	mc_overlay.removeEventListener(MouseEvent.MOUSE_DOWN, show_plugins);
	mc_overlay.addEventListener(MouseEvent.DOUBLE_CLICK, show_plugins);
}

//plugin actions
function set_plugin_show(){
	krpano.set("plugin[yourplugin].visible", "true");
}
function set_plugin_hide(){
	krpano.set("plugin[yourplugin].visible", "false");
}

//get plugin vars
function get_plugin_visible(){
	return krpano.get("plugin[yourplugin].visible");
}
...


and the XML

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
...
<plugin name="overlay"
		url="plugins/overlay.swf"
		align="lefttop" x="0" y="0"
		borderwidth="0"
		width="100%"
		height="100%"
		alpha="1"
		handcursor="false"
		visible="true"
		enabled="true"
		capture="false"/>
...


any ideas?

3

Wednesday, August 18th 2010, 11:54am

Hi,

try - enabled="false",

best regards,
Klaus

4

Thursday, August 19th 2010, 5:10pm

I'm sorry, this doesn't work.
Setting enabled="false" disables the plugin to receive mouse events.
But the hotspots are working of course this way.

I simply want to set my plugin behind the hotspots.

Any other ideas?
Thanks

This post has been edited 1 times, last edit by "mayanic" (Aug 20th 2010, 1:07pm)


5

Monday, August 23rd 2010, 4:00pm

Hi,
I simply want to set my plugin behind the hotspots.
sorry, but that's not possible, the plugins and hotspots are internally on two different layers, and the plugins layer is always over the hotspots layer...

best regards,
Klaus

sasky

Beginner

Posts: 17

Occupation: Trying to live as anybody else...

  • Send private message

6

Wednesday, August 25th 2010, 9:37pm

what about "zorder" ??

7

Thursday, August 26th 2010, 8:51am

Hi,

the zorder works only within a layer,

but you when are working from AS3 you could try to add your visible elements manually to the hotspot layer,
e.g.

Source code

1
2
var hotspotlayer:Sprite = krpano.get("hotspot.layer");
hotspotlayer.addChildAt(0, your_as3_displayobject );


best regards,
Klaus

8

Friday, August 27th 2010, 2:20pm

Source code

1
2
var hotspotlayer:Sprite = krpano.get("hotspot.layer");
hotspotlayer.addChildAt(0, your_as3_displayobject );

you sir, are a genius
Although it works with:

Source code

1
hotspotlayer.addChildAt(your_as3_displayobject, 0);

The indexing should be second, the object first

Thank you very much *g*