Sie sind nicht angemeldet.

kosmodroms

Anfänger

  • »kosmodroms« ist der Autor dieses Themas

Beiträge: 40

Wohnort: Latvia

Beruf: Kosmodroms | Digital Creative Studio - programmer, designer

  • Nachricht senden

1

Freitag, 4. Januar 2013, 11:25

Smarter hotspots - dynamic scene title on rollover and looktohotspot with dynamic hotspot name

I like dynamic code, so I added some lines to my xml and hotspot plugin code.
I wanted to show scene name on hotspot rollover but without typing the scene title again and again in the xml.
Also I wanted to add looktohotspot action without having to hardcode hotspot name every time I call it.

So I replaced hotspot onclick with scenetoload param,
added hotpost style with onclick action where I get scenetoload param from hotspot itself,
and added gotonewscene action which includes looktohotspot and loadscene


Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!--  actions -->
	<action name="gotonewscene">
		looktohotspot(%2, 75, smooth(300,-300,600));
		loadscene(%1, null, MERGE, BLEND(1));
	</action>

<!-- hotspot styles -->
	<style 
		name="hotspot_goto" 
		url="%BASEDIR%/hotspots/hs.swf" 
		alturl="%BASEDIR%/hotspots/hs.png" 
		onover="set(zorder, 2000);"
		onclick="gotonewscene(get(scenetoload), get(name))" 
	/>

<!-- scenes -->
<scene name="scene_wardrobe" title="Wardrobe" > 

<!-- goto gotspots --> 
<hotspot name="goto1" style="hotspot_goto" ath="185" atv="4" scenetoload="scene_wardrobe" />


And in the hotspot code, I added rollover/out listeners and label,
also some code to set label text to show scene title which the hotspot will load on click (scenetoload param from xml)

Quellcode

1
2
3
4
5
6
7
hit.addEventListener(MouseEvent.ROLL_OVER, showLabel);
hit.addEventListener(MouseEvent.ROLL_OUT, hideLabel);

public function registerplugin(krpanointerface:Object, pluginfullpath:String, pluginobject:Object):void {
	var scenetoload:String = (_krpano.get("hotspot[" + _plugin.name+ "].scenetoload"));
	setLabelText(_krpano.get("scene[" + scenetoload + "].title"));
}


Hope this is usefull! Cheers!

Here's an exapmple: hotspot demo 2.zip
Edgars
Kosmodroms | Digital Creative Studio
www.kosmodroms.lv

Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von »kosmodroms« (25. Februar 2013, 11:30)


2

Freitag, 4. Januar 2013, 12:16

Wow!
thank you very mach for sharing!
Excellent and useful solution!
*tongue*
Panoreal — to make and see this wonderful world! *whistling*

3

Freitag, 4. Januar 2013, 12:25

Nice solution* *thumbup*

4

Samstag, 5. Januar 2013, 22:01

Hi kosmodroms,
I can not imagine this code working without your example.
Can you show some?
Marty

kosmodroms

Anfänger

  • »kosmodroms« ist der Autor dieses Themas

Beiträge: 40

Wohnort: Latvia

Beruf: Kosmodroms | Digital Creative Studio - programmer, designer

  • Nachricht senden

5

Samstag, 5. Januar 2013, 23:48

I coded it for http://gipsafabrika.lv/virtual-tour/en/ hotspots.
I have to make a sample tour with full code - I'll try to do it next week if it's necessary.
Edgars
Kosmodroms | Digital Creative Studio
www.kosmodroms.lv

6

Montag, 7. Januar 2013, 11:12

Dank für die Share!

Die Beispiel tour ist Super gemacht!^^

kosmodroms

Anfänger

  • »kosmodroms« ist der Autor dieses Themas

Beiträge: 40

Wohnort: Latvia

Beruf: Kosmodroms | Digital Creative Studio - programmer, designer

  • Nachricht senden

7

Montag, 7. Januar 2013, 13:34

Vielen Dank!
Edgars
Kosmodroms | Digital Creative Studio
www.kosmodroms.lv

octavias

Anfänger

Beiträge: 29

Wohnort: New York

Beruf: Photographer

  • Nachricht senden

8

Samstag, 23. Februar 2013, 21:55

Hey Kosmodrom, I llove this function!

I am using Pano Tour Pro 1.8. how would i implement it in my theme there? any ideas?

-Octavias
Panoramic photographer, 360 video cinematographer & developer from New York :)

ACMB Photography - 360 Virtual Tours
Koncept VR - 360 Video & VR Production

kosmodroms

Anfänger

  • »kosmodroms« ist der Autor dieses Themas

Beiträge: 40

Wohnort: Latvia

Beruf: Kosmodroms | Digital Creative Studio - programmer, designer

  • Nachricht senden

9

Montag, 25. Februar 2013, 10:33

Hi! I'm not familiar with Pano Tour Pro. I guess it's a GUI for creating and editing krano xml. I'm not quite sure if it can be done using Pano Tour interface.
You have to create swf file for plugin with the specific as3 code inside (in Adobe Flash or similar), then you must add some extra parameters to each scene and custom onclick for hotpspot style. Can this be done in Pano Tour Pro ?
Edgars
Kosmodroms | Digital Creative Studio
www.kosmodroms.lv

kosmodroms

Anfänger

  • »kosmodroms« ist der Autor dieses Themas

Beiträge: 40

Wohnort: Latvia

Beruf: Kosmodroms | Digital Creative Studio - programmer, designer

  • Nachricht senden

10

Montag, 25. Februar 2013, 11:22

I can not imagine this code working without your example.


I added a small example to original post (zip archive).
Edgars
Kosmodroms | Digital Creative Studio
www.kosmodroms.lv

11

Dienstag, 26. Februar 2013, 03:47



I added a small example to original post (zip archive).
Thank you for the zipped Smarter hotspots tutorial!

Phil

12

Dienstag, 30. April 2013, 04:21

Hi Edgards!
Tell me please what method did you button Twitter and Facebook, you could share your code?
Please, if this is not a trade secret.
*rolleyes*
Panoreal — to make and see this wonderful world! *whistling*

  • »edgars@kosmodroms« ist der Autor dieses Themas

Beiträge: 40

Wohnort: Latvia

Beruf: Kosmodroms | Digital Creative Studio - programmer, designer

  • Nachricht senden

13

Donnerstag, 26. September 2013, 14:29

Arsdezi sory for delayed answer - I think it was the SWFAddress plugin (krpano.com/plugins/userplugins/swfaddress/) with small adjustments to fit my needs.
Edgars
Kosmodroms | Digital Creative Studio
www.kosmodroms.lv

360boy

Fortgeschrittener

Beiträge: 249

Wohnort: Mexico City

Beruf: Virtual tours, Krpano coding, Graphic Design, Photographer, Panographer

  • Nachricht senden

14

Montag, 3. Februar 2014, 20:05

Lovely and pretty useful plugin Edgars, I've been searching how to do this function for a while and your very detailed example really helps a lot.

Thousand thanks! *thumbsup*

Luis

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »360boy« (11. Februar 2014, 03:03)