Sie sind nicht angemeldet.

1

Montag, 16. August 2010, 17:56

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

Dienstag, 17. August 2010, 12:15

Code

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

Quellcode

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

Quellcode

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

Mittwoch, 18. August 2010, 11:54

Hi,

try - enabled="false",

best regards,
Klaus

4

Donnerstag, 19. August 2010, 17:10

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

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »mayanic« (20. August 2010, 13:07)


5

Montag, 23. August 2010, 16:00

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

Anfänger

Beiträge: 17

Beruf: Trying to live as anybody else...

  • Nachricht senden

6

Mittwoch, 25. August 2010, 21:37

what about "zorder" ??

7

Donnerstag, 26. August 2010, 08:51

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.

Quellcode

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


best regards,
Klaus

8

Freitag, 27. August 2010, 14:20

Quellcode

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

you sir, are a genius
Although it works with:

Quellcode

1
hotspotlayer.addChildAt(your_as3_displayobject, 0);

The indexing should be second, the object first

Thank you very much *g*