|
|
Simple panorama auto-presentationThis is an example of creating an auto-presentation for your panorama. Contributed by Patrick Cheatham. Using a short series of custom functions in your XML file, Flash Panorama Player can move your panorama through a series of pan, tilt and zoom movements. This example also shows how to write and name your custom functions, keeping them grouped together in your global element. This way you always know where your functions are and how to target them. <panorama>
<parameters> layer_20 = files/hotspots.swf tiltHome = -90 zoomHome = 2 </parameters> <hotspots> <global onStart="global.cl_pano_move" cl_pano_move="pano.pan=143,1900;pano.zoom=1,100;pano.tilt=0,800,,global.pano_move2" cl_pano_move2="pano.pan=80,1000;pano.tilt=-15,500;" cl_pano_move3="pano.pan=10,1500;pano.tilt=5,500,,global.pano_move;" > <pano></pano> <spot id="hotspot_1" static="1" salign="rb" staticX="-113" staticY="-65" url="files/My/Image.png" onClick="global.cl_pano_move" /> <spot id="hotspot_2" static="1" salign="rb" staticX="-150" staticY="-65" url="files/My/Image2.png" /> <spot id="hotspot_3" static="1" salign="rb" staticX="-190" staticY="-65" url="files/My/Image3.png" onClick="global.cl_pano_move3" /> <spot id="hotspot_4" static="1" salign="rb" staticX="-230" staticY="-65" url="files/My/Image4.png" onClick="fullscreen(-)" /> </global> </hotspots> </panorama> The parameters element shows how to set the tiltHome and zoomHome parameters when your panorama loads. This is just for the sake of example -- you can delete these or set them however you wish. The global element contains an onStart function, which simply tells the panorama to run the custom function* cl_pano_move after the panorama loads. cl_pano_move tells the panorama to: Pan to 143° in 1.9 seconds. At the same time, Zoom to a zoom factor of 1 in a tenth of a second and Tilt to 0°, taking 1.9 seconds to do so. The Tilt part also says to run the second custom function when done (cl_pano_move2). cl_pano_move2 changes the panorama's Pan and Tilt settings, and then does nothing else. cl_pano_move3 changes the panorama's Pan and Tilt settings, and then says to run the first custom function (cl_pano_move). The hotspots hotspot_1 and hotspot_3 each say to run one of the custom functions onClick. See how these two onClick events target the function by putting "global." in front of the function's name? The hotspot hotspot_4 simply toggles fullscreen mode. Easy! Of course, your custom functions can do much more than move your panorama around -- you can change settings for individual hotspots, such as visible, or staticX and so on... Possibilities abound! * note that your custom functions can be named whatever you like -- i use "cl_" at the beginning as shorthand for "cheathamlane" (my company), so that i know i wrote the function. the rest of the custom functions "pano_move" and "pano_move2" are just numbered sequentially so it's easier to keep track of them. * these custom functions are in the "standard" fpp format, as outlined in the fpp documentation. that is, something like: function_name=
"what_to_act_upon.action_to_take=amount, time, type_of_tween, what_to_do_next, what_to_do_if_interrupted" [update: if you're interested in having your panorama automatically go to a horizon line, or a specific pan/tilt after a certain amount of time -- and you don't want to mess with code |
New forum topicsRecent commentsWho's onlineThere are currently 0 users and 5 guests online.
|
Update: When using a custom
Update:
When using a custom function to change the Zoom factor of your panorama, make sure that you don't try to set the Zoom to a factor larger than your "zoomMax" parameter.
As of this writing, FPP version 2.2 will simply fail to complete your custom function if you have set "zoomMax" in your parameters, and then try to set the Zoom factor to something higher.
Figured out in the FPP forums by Hans Nyberg
Thanks Patrick I need to
Thanks Patrick
I need to complete the automatic functions with a full tour launching a new pano with a new autotour and so on making it a running loop to show on a large screen.
I also want to do automatic fading in and out popups with a text for each pano.
My client will just be wild if I can do a demo with that.
I seen one in the gallery (just looping panos) I believe, but now I can not find it.
Hans
Hey Hans: Well, one place
Hey Hans:
Well, one place (in the example above) to bring in a new panorama would be in the "what_to_do_next" part of the code. You'd just write a standard FPP "loadPano()" function and put it there.
As to the fading in/out popups -- on my list!
Auto-Presentation tutorial
Auto-Presentation tutorial updated 12/24/2007. Code example was corrected.