View Full Version : How do you flash up hints after a pan loads?
masten
11-12-2008, 11:02 PM
Hello
I want to flash up
"Click & Drag to view" a few times followed by "Use Mouse wheel to zoom in & out" a few times
after a panorama is loaded and autorotating
phberlin pointed this out to me a while ago when I wanted to do something similar with a fullscren hint.
---------------------------------------------
<spot id="fullscreen_hint" url="your_image_file.png" static="1" salign="TR" align="TR" staticX="-180" alpha="0" visible="0" /
Code:
flash_image="fullscreen_hint.visible=1;
fullscreen_hint.alpha=1,400,,flash_image_2;"
flash_image_2="fullscreen_hint.alpha=0,400,,flash_image_3;"
flash_image_3="fullscreen_hint.alpha=1,400,,flash_image_4;"
flash_image_4="fullscreen_hint.alpha=0,400,,flash_image_5;"
flash_image_5="fullscreen_hint.alpha=1,400,,flash_image_6;"
flash_image_6="fullscreen_hint.alpha=0,400,,flash_image_7;"
flash_image_7="fullscreen_hint.visible=0;"
---------------------------------------------
I cant figure out though how to integrate that code. How do I get it to start up. Does it go in the Global bit? How do I attach code like that to an event, and what event do I use?
I cant find a onPanoramaLoaded event?
I dont use transitions or anything like that. Panorama name is specified in html file. It loads. Then plugins & hotspots load.
thanks
Masten
siesfor
11-13-2008, 12:35 AM
set your spots up, as you would normally...
<spot id="click_hint" url="your_image_file.png" static="1" salign="TR" align="TR" staticX="-180" alpha="0" visible="0" />
<spot id="mouse_hint" url="your_image_file.png" static="1" salign="TR" align="TR" staticX="-180" alpha="0" visible="0" />
we'll call 'em "click_hint" and "mouse_hint"
then, inside <global> add
flash_click="
click_hint.visible=1;
click_hint.alpha=1,400,,flash_click_2;"
flash_click_2="click_hint.alpha=0,400,,flash_click_3;"
flash_click_3="click_hint.alpha=1,400,,flash_click_4;"
flash_click_4="click_hint.alpha=0,400,,flash_click_5;"
flash_click_5="click_hint.alpha=1,400,,flash_click_6;"
flash_click_6="click_hint.alpha=0,400,,flash_click_7;"
flash_click_7="click_hint.visible=0; flash_mouse()"
flash_mouse="
mouse_hint.visible=1;
mouse_hint.alpha=1,400,,flash_mouse_2;"
flash_mouse_2="mouse_hint.alpha=0,400,,flash_mouse_3;"
flash_mouse_3="mouse_hint.alpha=1,400,,flash_mouse_4;"
flash_mouse_4="mouse_hint.alpha=0,400,,flash_mouse_5;"
flash_mouse_5="mouse_hint.alpha=1,400,,flash_mouse_6;"
flash_mouse_6="mouse_hint.alpha=0,400,,flash_mouse_7;"
flash_mouse_7="mouse_hint.visible=0;"
giving it the instructions, first, to flash off and on the click hint 3 times over about 2.5 seconds, then to follow up with the same for the mouse hint.
adjust the speed with the "400".
to get it started, I believe you'll need to scrap using the html to call the pano, and instead call the xml file, which will then call your pano from inside the <global> tag...
onStart = "loadOne()"
loadOne = "
loadPano( fill in your loadPano info );
onTransitionEnd = flash_click(); "
onStart is an FPP command on what to do once the xml has been loaded.
loadOne is just a generic name, use whatever you'd prefer.
once the pano has finished loading, onTransitionEnd kicks in and triggers flash_click which starts the hints to flashing.
Also, you'll need to add
disableLoading = 1
inside your <parameters> tags.
Then just fill in the loadPano and <spot> info, and adjust your hint images where you'd like them, and you're set.
masten
11-14-2008, 02:44 PM
hey siesfor
Hi there. Thanks alot for the comprehensivce reply. As a very basic coder I really appreciate that. Big help. Ill give it a shot and get back to you.
cheers
Masten
masten
11-14-2008, 03:59 PM
Wow, I got this to work for the most part.
Just one small problem
panoName=pans/xxx
parameter now doesnt work so I have to put cube faces in with swf, html and xml files. Very messy. I usually keep them in a separate /pans folder
Any way to fix this?
cheers
Masten
siesfor
11-14-2008, 04:46 PM
Hmm, it shouldn't affect your location of cube files.
I'm guessing the panoName parameter is inside the <parameter> tags?
If so, you need to place your panoName info inside of the loadPano call in the loadOne function, ie...
onStart = "loadOne()"
loadOne = "
loadPano(?panoName=pans/xxx,,none);
onTransitionEnd = flash_click(); "
What it's doing is, since "disableLoading = 1" nulls out the panoName in the <parameters> brackets, FPP goes straight to the <hotspots> section where onStart tells it which function to perform first. From there we can use the loadPano function to call up the panoName, the transition time, and transition style. This is especially useful when building long, multi-pano tours, instead of having to create seperate xmls for each.
masten
11-15-2008, 11:52 AM
siesfor
Excellent. tried that . All works.
Modified it like this
---------------------------------
<global
flash_click="
click_hint.visible=1;
click_hint.alpha=1,400;timer+=1,1000,,flash_click_ 2;"
flash_click_2="click_hint.alpha=0,400,,flash_click_3;"
flash_click_3="click_hint.visible=0; flash_zoom();"
flash_zoom="
zoom_hint.visible=1;
zoom_hint.alpha=1,400;timer+=1,1000,,flash_zoom_2;"
flash_zoom_2="zoom_hint.alpha=0,400,,flash_zoom_3;"
flash_zoom_3="zoom_hint.visible=0;"
onStart = "loadOne()"
loadOne = "
loadPano(panoName=pans/bar,0, visible);
onTransitionEnd = flash_click(); "
>
-----------------------------------------------
So 'click and drag to view' fades in for a few seconds, then 'use mouse wheel to zoom' does the same
Only one problem now is the other hotspots (static and in-pan all defined outside of global) now load before the panorama loads which looks weird.
How do I make them load after like they used to when the pan was called from the parameters tag
thanks
Masten
siesfor
11-15-2008, 04:54 PM
check out the "linked" parameter under Spot object parameters in the Hotspots Tutorial.
It'll cause the hotspots to only become visible once the pano they're "linked" to is loaded.
masten
11-16-2008, 10:05 PM
And that worked too,
You are a wizard!
I had to use unlinked not linked. No idea why it works but it does.
Here's (http://www.virtutour.com/tests/hodsockpriory) the finished version:
(links dont work btw)
so thanks for all your help on this.
'see' you here again sometime maybe
cheers
Masten
vBulletin® v3.7.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.