Professional Documents
Culture Documents
Using parameters
Using plugins
Hotspots plugin
Embed to HTML
Flash version detection
Benefits
No Flash experience is required. You can create your panorama exhibitions
using simple text editor.
Offline panoramas
Full multiplatform support. Works the same for Windows, Mac and Linux.
Examples
Supports QTVR files, separate cube faces, cube stripes, spherical and
cylindrical images.
Can be used to create both online and offline applications. Can be
converted to standalone application.
Can be embedded to any HTML or Flash site (Flash site should be
compiled as Actionscript 3 application).
The panorama player is fully customizable, you can change scores of
parameters, you can draw your own controls and buttons.
Using Actionscript you can write new plugins for the player, create new
transition effect, load the player to other Flash/Flex/AIR applications.
All Flash Panorama Player updates (including panorama engine updates
and new plugins) are free for Flash Panorama Player customers.
HTML-less variant
2. Use show_pano.swf?movie=nature.swf link instead of nature.swf (pass the movie parameter - the
movie name you want to load after Flash version check).
Example: http://www.flashpanoramas.com/player/test/show_pano.swf?movie=nature.swf
If you don't like the additional parameter in URL, there is another way to simplify the link: show_pano.swf
can define the movie parameter automatically (taking the second word of the detector movie name).
3. So, to make a separate Flash Player checker for the panorama, just change the name of the player to
show_[pano name].swf.
For nature.swf we have change the detector name from show_pano.swf to show_nature.swf:
Actually, it doesn't matter what the first word is in the version detector name. You can change it as you wish:
go_nature.swf or panorama_nature.swf (the file nature.swf will be loaded anyway).
Pressing Yes user starts Express Install (quick automatic Flash Player update).
Whole process performs without leaving the page, inside the Flash movie window:
The weight of the update package is about 1 Mb (less then ordinary good quality panorama).
The process is done in minutes, new window with your movie will open automatically (the old window with
overdue Flash Plugin object should be closed, user got the alert notification to close the window):
This process looks the same for all browsers and for all operation systems (benefit of the cross-platform
technology).
And this process performs only once if user hasn't the Flash Player 9.
HTML variant
2. Use SWFObject (add this code to your HTML file):
<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent">
This content requires Adobe Flash Player 9 plugin. Please, visit <a
href="http://www.adobe.com/go/getflashplayer/">adobe.com</a> and install it.
</div>
<script type="text/javascript">
var so = new SWFObject("show_pano.swf", "pano", "100%", "100%", "6.0.65", "#999999");
so.addVariable("movie", "nature.swf");
so.addVariable("redirect", window.location);
so.write("flashcontent");
</script>
Main points:
1. Set version 6.0.65 for the new SWFObject creation.
2. Pass movie parameter to point to the Flash Panorama Player application using
so.addVariable("movie", "nature.swf"); function.
3. Pass redirect parameter URL to open new window after ExpressInstall complete. window.location
means that new window will use the current page URL.
Example: http://flashpanoramas.com/player/test/detect.html
show_pano.swf and ExpressInstall works here exactly the same way as for HTML-less variant. Only one
difference: if user has very old plugin (less then 6.0.65 version, without possibility of ExpressInstall, or has no
Flash Player at all), he will see the default HTML content instead of the Flash Player window:
This content requires Adobe Flash Player 9 plugin. Please, visit adobe.com and install it.
You can change this default message in the code snippet above.
Embed to HTML
You can embed the Flash Panorama Player to the web page as any other regular Flash movie.
There is only one piece of subtlety: you should notice that the Flash Panorama Player window has no
predefined sizes, the player works ok for any window size and for any dimensions ratio. So, just use as many
size for your panorama on your page as you have. You can use the movie window size specified in percents
if you want to create a flexible page design, the Flash Panorama Player handles the dynamic size changes
correct as well.
Use SWFObject
The best practice to embed Flash content for today is SWFObject, small javascript written by Geoff Stearns
(if you are not using it still, download it right now from here: http://blog.deconcept.com/swfobject/).
Benefits of SWFObject:
1. Easy to use.
2. No problems with the ActiveX initialization in Internet Explorer.
3. Generates valid HTML or XHTML 1.0 documents.
Typical html code snippet:
<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent">
This text is replaced by the Flash movie.
</div>
<script type="text/javascript">
var so = new SWFObject("nature.swf", "pano", "550", "400", "9", "#666666");
so.write("flashcontent");
</script>
This code will create a fixed size window (550x400) for the Flash Panorama Player and load nature.swf
movie.
http://flashpanoramas.com/player/test/embed1.html
Be sure you have all files accessible for your HTML page:
http://flashpanoramas.com/player/test/embed3.html
Both dimensions to 100%:
var so = new SWFObject("nature.swf", "pano", "100%", "100%", "9", "#666666");
http://flashpanoramas.com/player/test/embed4.html
Files description
The Flash Panorama Player package includes:
1. License.txt - product license, read it once.
2. WhatsNew.txt - main changes for this version.
3. pano.swf - main application file, Flash Panorama Player.
4. pano0.swf - the same as pano.swf?panoType=cube0.
5. panoStripe.swf - the same as pano.swf?panoType=stripe.
6. Examples.htm - examples starting page.
7. Tutorials.htm - tutorial starting page.
8. plugins folder contains all currently available plugins.
9. tutorials folder contains current tutorial set.
Watch the blog (http://flashpanoramas.com/blog) to handle last updates and examples.
API Functions
getParams(listOfParams:Array, returnSlot:String, functionName:String); - function to send a query with
a list of intresting parameters; values of parameters will be returned to your application with another
LocalConnection call.
Example:
ExternalInterface.call("window.document['"+movieName+"']."+ExternalInterfaceID+"PanoSet",
"pano.panKey", -2);
setParams(listOfParams:Array, listOfValues:Array); - function to set parameters
Example: pan =
ExternalInterface.call("window.document['"+movieName+"']."+ExternalInterfaceID+"PanoGet",
"pano.pan");
execute(commandLine:String, scope:String="global"); - function to execute Hotspots script fragment
Example:
ExternalInterface.call("window.document['"+movieName+"']."+ExternalInterfaceID+"PanoExecute",
"pano.saturation+=2,1000,elastic,onDone");
You can find working example and the source (ExternalTest.fla) file in examples folder of your Flash
Panorama Player package.
API Functions
getSlot(dumpSlot: String); - subservient function to get the active API slot.
getParams(listOfParams:Array, returnSlot:String, functionName:String); - function to send a query with
a list of intresting parameters; values of parameters will be returned to your application with another
LocalConnection call.
Example: _lc.send(masterSlot, "getParams", ["pano.pan", "pano.tilt"], slaveSlot, "callback");
setParams(listOfParams:Array, listOfValues:Array); - function to set parameters
Example: _lc.send(masterSlot, "setParams", ["pano.pan", "pano.tilt"], [10, 20]);
execute(commandLine:String, scope:String="global"); - function to execute Hotspots script fragment
Example: _lc.send(masterSlot, "execute", "pano.pan=10;pano.tilt=20;");
You can find working example and the source (controller.fla) file in examples folder of your Flash
Panorama Player package.
Hotspots
Hotspots plugin allows to add hotspots to your panorama.
Also it provides a possibility to programme events, motion tweens, external calls and new panorama loadings to make various interactions
in your panorama application.
How to read this tutorial? It's big, yes. But don't be afraid, mostly it is a description of properties. You do not need it all right now. I
recommend to read at first the second chapter (Syntax of Hotspots parameters) to understand the main principles. It's enough to
understand how to add new hotspots to the XML file. All static properties of these hotspots you can edit later using Editor plugin. Also I
recommend to read the last chapter (Debug panorama application) and to install the Flash debugger to understand what's going on with
your panorama application at runtime.
Later you can return to this tutorial to get new properties extending your panoramas functionality.
Key features
Syntax of Hotspots parameters
1. Introduction
2. Objects (global, pano, spot, box and external)
3. Functions
4. Assignments and motion tweens
Parameters description
1. Filters (visual effect)
hue, saturation, brightness, contrast, tint, blur, sharpness, bevel, glow, shadow.
2. Global object parameters
Numerical: timer.
String: LocalConnectionID, ExternalInterfaceID, disableReloading.
Events: onStart, onNewPano, onTransitionStart, onTransitionEnd, onActivate, onDeactivate, onEnterFullscreen,
onExitFullscreen, onLoad, onOver, onOut, onPress, onRelease, onClick.
Build-in functions: openUrl, loadPano, fullscreen, javascript:.
3. Pano object parameters
Numerical: timer, pan, tilt, zoom, hfov, vfov, segments, sensitivity, keySensitivity, friction, threshold, pan_v, tilt_v,
zoom_v, panKey, tiltKey, zoomKey.
String: behaviour, qualityMotion, qualityStatic, leash, disableKeys, disableWheel, disableControls, disableTilt,
disablePan.
Events: onPress, onRelease, onKeyPress.
4. Spot object parameters
Numerical: timer, depth, pan, tilt, scale, scaleX, scaleY, rotation, alpha, staticX, staticY, alignX, alignY, salignX, salignY,
soundVolume, soundRadius, soundPan.
String: id, url, linked, unlinked, visible, scaleable, static, opaqueBackground, blendMode, smoothing, pixelSnapping,
align, salign, cacheAsBitmap, buttonMode, blockMouse, useHandCursor, enableSoundPanning.
Events: onLoad, onOver, onOut, onPress, onRelease, onClick.
5. Box object parameters
Numerical: timer, depth, pan, tilt, distance, rotationX, rotationY, rotationZ, scale, scaleX, scaleY, rotation, alpha, staticX,
staticY, alignX, alignY, salignX, salignY, refreshRate, shrink, segments, segmentsX, segmentsY, soundVolume,
soundRadius, soundPan.
String: id, url, linked, unlinked, visible, distorted, orientation, scaleable, static, opaqueBackground, blendMode,
smoothing, pixelSnapping, align, salign, cacheAsBitmap, buttonMode, blockMouse, useHandCursor,
enableSoundPanning.
Events: onLoad, onOver, onOut, onPress, onRelease, onClick.
Debug panorama application
Key features
1. Hotspot objects can load external images (jpg, png or gif) or Flash movies (swf files compiled for 1-9 Flash Player version). It's
possible to load external Flash applications and streaming audio/video content. See spot url property for more info.
2. Hotspots plugin supports "distorted" hotspots (box object) to place images, videos and Flash applications directly to panorama
image. Hotspots script gives you a possibility to control these objects in 3D space at runtime.
3. All parameters described by Hotspots XML can be changed using internal script at runtime; you can change parameters instantly or
use motion tweens, you can change functions themselves, you can call functions and run effects one by one using onDone and
onInterrupt events, you can change parameters of external plugins (like Limits and Autorotation).
4. It is possible to load new panorama images with loadPano command, you can control transition effect, new panorama position, new
borders and autorotation setting, and you can make even your own custom transition effects (see onTransitionStart example).
5. linked parameter is a simple way to set a configuration of hotspots for every panorama in a panorama tour. Just point the linked
panorama name and hotspots will be automatically loaded/unloaded depends on current panorama image.
6. You can apply various Flash visual effects to panorama application as a whole and use them separately to the panorama image and
for every hotspot. Current version of Hotspots plugin provides 9 visual effects: hue, saturation, brightness, contrast, tint, blur,
bevel, glow and shadow.
7. You can debug your panorama application.
Create any number of <box> and <spot> tags between <global> and </global>. Each tag generates one hotspot object (distorted or not
distorted).
Attributes of tags <global>, <pano>, <spot>, <box> can be either a variable:
url="myPicture.jpg" and visible="0"
or a function:
onClick="openUrl(http://flashpanoramas.com/)" and myFunction="pan=100; anotherMyFunction()"
Functions can contain one or more variable assignments and other function calls.
Divide commands inside the function using ";" or line feed to make the code more readable:
<spot id="123"
onClick="
pan = 100, 1000
tilt = 20, 1000
loadPano(new.swf)
"
/>
All insignificant white spaces are ignored.
All variables and function names are not case sensitive, so this is a correct string:
onCLICK="Pan=10;Loadpano(my.swf)"
Objects
Hotspots plugin have 5 types of objects: global, pano, spot, box and external. They have different set of parameters.
Global object defined by global tag in the XML file:
<global onLoad="alpha=0; alpha=1,1000" >
There is only one global object in your panorama application.
Use global prefix to address global object parameters:
<spot url="invertButton.jpg" onClick="global.saturation=-1" /> (invert all colors for the application on this spot click)
Pano object is predefined by pano tag in the XML file:
<pano pan="100" tilt="-10" />
There is one pano object at the application start, two pano objects after loadPano command; and then after a transition effect there is only
one pano object again (the previous panorama is unloading from the memory).
All loaded panoramas get properties from pano tag. This example makes all panoramas loaded with loadPano to use leash=free
parameter (old and new panoramas have independent pan, tilt and zoom) and to increase contrast by 50%:
<pano leash="free" contrast="0.5" />
Use pano prefix to address the main panorama object, use pano2 prefix to access new loaded panorama:
<global onTransitionStart="pano2.saturation=1" onTransitionEnd="pano2.saturation=0,500" > (shows loaded panorama as black and
white picture, appears colors back after a transition effect)
Spot object is a simple type of hotspots in Hotspots plugin.
Spot object attaches to the panorama in a single point (align point) and has no distortions during panorama transition. This provides good
redraw performance.
Also spot object can be statically aligned to the panorama window (static parameter) instead of panorama surface (to make navigation
controls).
Functions
Functions give a possibility to organize a complex functionality:
<spot url="picture1.jpg" static="1" onOver="makeBigger();" onOut="restorePosition();restoreSize();"
onPress="makeBigger();goDown()" onRelease="restorePosition()" goDown="staticY+=5" makeBigger="scale+=0.1"
restorePosition="staticX=0" restoreSize="scale=1" />
You can set any number of functions for any object. Use unique function names for your own functions (like moveToTheNextHotspot and
showNavigationButtons) or use one of predefined event identifiers (onClick, onLoad, onTransitionStart) if you want your function be
called with some event.
To execute commands stored in the function, use [function name](). To call function described in another object, use [object
name].[function name]():
<spot id="spot1" url="1.jpg" onClick="spot2.onClick(); spot3.hideMe(); global.deactivate()" />
The scope of the function (where commands will find parameters and other functions) is a called object:
<spot id="pic1" url="picture1.jpg" pan="10" onClick="pic2.scaleIt()" />
<spot id="pic2" url="picture2.jpg" pan="20" scaleIt="scale=2" /> (changes scale of pic2 spot, equivalent to pic2.scale=2)
The only exception is "function by default". If Hotpots engine can't find a function for the called object, it tries to call it on the global object,
but the scope of function is a first called object (this feature allows to determine the behaviour for all panorama spots with only several
strings):
<global onClick="visible=0" >
<spot id="pic1" url="picture1.jpg" pan="10" /> (this spot has no onClick so when you click it, the function global.onClick() fires with
scope of pic1. I.e. visible=0 means pic1.visible=0. It makes the spot invisible).
<spot id="pic2" url="picture2.jpg" pan="20" />
<spot id="pic3" url="picture3.jpg" pan="30" onClick="" /> (this spot has onClick function (do nothing) and doesn't call global onClick)
</global>
You can change functions at runtime:
<spot
<spot
<spot
<spot
onClick="pano.pan+=200,10000,elastic,myDone,myInterrupt" (increases panorama pan by 200 during 10 seconds using elastic motion
tween; call myDone function when motion tween is done, call myInterrupt if motion tween was interrupted).
onDeactivate="saturation=-1,1000" (change saturation from current value to -1(black and white) during 1 second using default smooth
motion tween type)
onActivate="saturation=0,1000,,,myInterrupt" (change saturation to 0 (default) during 1 second using default smooth motion tween type;
call myInterrupt if motion tween was interrupted)
Type of tween can be regular, smooth, strong, easyIn, easyOut, elastic or bounce. Default value is smooth.
Done function executes if motion tween is finished. This is a way to make a sequence of actions one by one. You can use your own
functions:
<spot url="img.jpg" onOver="scale=2,500,smooth,buttonTremor" buttonTremor="scale=1.8,500,bounce" onOut="scale=1,300" / >
<spot onClick="pan+=10,1000,regular,onClick" / > (this spot will move horizontally without end after user click it).
<spot onClick="pano.pan+=10,1000,regular,onClick" / > (this will start panorama rotation after user click it).
Parameters description
Filters (visual effect)
hue, saturation, brightness, contrast, tint, blur, sharpness, bevel, glow, shadow.
Filters are special parameters for all types of objects. You can apply filter the same way: global.tint=1 or pano.tint=1 or spot1.tint=0.
Some filters have additional subparameters, for example, tintColor to set color of tint parameter: global.tint=1;global.tintColor=#0000FF.
Filters as shadow and glow are invisible for pano and global objects in common case but can be applied anyway.
Filter sharpen is not recommended for pano and global (too slow).
Filters blur, hue, saturation, contrast and tint applying to global object change the view of all objects on in the panorama player including
hotspots and all loaded plugins.
Use Editor plugin to play with filters.
hue changes hue value
hue=1 (moves colors to a half of color cycle)
Default value is 0.
saturation changes hue
saturation=1 (makes colors of this hotspot twice saturated)
saturation=-1 (makes this hotspot black and white)
saturation=-2 (inverts colors of this hotspot)
Default value is 0.
brightness changes brightness
brightness=1 (gives maximal brightness)
brightness=-1 (gives minimal brightness)
Default value is 0.
contrast changes contrast value
contrast=1 (gives more contrast)
contrast=-1 (gives less contrast)
contrast=-2 (inverts the image)
Default value is 0.
tint applies tint effect
tint=1 (full tint effect)
Default value is 0.
Additional parameter: tintColor (sets the color for tint in hexadecimal format).
Applies sepia effect on focus lost:
<global tintColor="#ac7a33" onDeacticate="tint=1,1000" onActivate="tint=0,400" onEnterFullscreen="onActivate">
blur applies blur effect
It changes blurX and blurY parameters.
blur=10 (applies blur filter with radius 10)
Default value is 0.
Additional blur parameters: blurX (changes horizontal component of blur [0..255]), blurY (changes vertical component of blur [0..255]),
blurQuality (changes blur quality, number of blur steps in fact: [1..15]).
Creates "depth of field" effect for the spot:
<spot id="front" url="front.jpg" blur="8" blurQuality="2" onOver="blur=0,300;pano.blur=4,300"
onOut="blur=8,300;pano.blur=0,300" />
bevel applies bevel effect
bevel=1 (adds a bevel with moderate intensity)
Default value is 0.
Additional bevel parameters: bevelDistance (changes bevel distance [-32..32]), bevelAngle (changes angle for bevel effect [-180..180]),
bevelHighlightColor (set bevel highlight color in hexadecimal format), bevelShadowColor (set bevel shadow color in hexadecimal format),
bevelHighlightAlpha (alpha effect for highlight color [0..1]), bevelShadowAlpha (alpha effect for shadow color [0..1]), bevelBlur (blur
effect for bevel [0..255]), bevelBlurX (horizontal blur effect for bevel [0..255]), bevelBlurY (vertical blur effect for bevel [0..255]),
bevelQuality (bevel quality, number of blur steps in fact: [1..15]), bevelType (type of bevel effect: inner, outer or full), bevelKnockout
(bevel knockout mode: 1 or 0).
Creates button with bevel effect:
<spot id="button" url="pic.jpg" bevel="1" bevelDistance="6" />
glow creates glow effect
glow=3 (adds noticeable glow effect)
Default value is 0.
Additional glow parameters: glowColor (sets glow color in hexadecimal format), glowAlpha (alpha effect for glow [0..1]), glowBlur (blur
effect for glow [0..255]), glowBlurX (horizontal blur effect for glow [0..255]), glowBlurY (vertical blur effect for glow [0..255]), glowQuality
(glow quality, number of blur steps in fact: [1..15]), glowInner (glow inner mode: 1 or 0), glowKnockout (glow knockout mode: 1 or 0).
Creates a dynamic effect (picture is blinking with red glow effect when you roll over it):
<box url="icon1.png" pan="10" glowBlur="30" segments="4" glowUp="glow=1.6,400,easyin,glowDown"
glowDown="glow=1,300,easyout,glowUp" onOver="glowUp()" onOut="glow=0,500" />
shadow adds a shadow to the object
shadow=1 (adds slight shadow below the object)
Default value is 0.
Additional shadow parameters: shadowColor (sets shadow color in hexadecimal format), shadowDistance (changes shadow distance [-
256..256]), shadowAngle (changes angle for shadow effect [-180..180]), shadowAlpha (alpha effect for shadow [0..1]), shadowBlur (blur
effect for shadow [0..255]), shadowBlurX (horizontal blur effect for shadow [0..255]), shadowBlurY (vertical blur effect for shadow
[0..255]), shadowQuality (shadow quality, number of blur steps in fact: [1..15]), shadowInner (shadow inner mode: 1 or 0),
shadowKnockout (shadow knockout mode: 1 or 0), shadowHideObject (shadow hideObject mode: 1 or 0).
Creates a button with shadow (when you press the button, it reaches it's shadow increasing 3D effect):
<spot url="button.png" static="1" shadow="2" shadowBlur="10" shadowDistance="10"
onPress="y+=4;shadowDistance=3;shadowBlur=4" onRelease="y-=4;shadowDistance=10;shadowBlur=10" />
onTransitionStart event, fires when the next panorama is loaded and transition effect starts
This example demonstrates how to make your own transition effect (the first panorama goes to blur, then the second one appears from the
blur effect):
<global onTransitionStart="pano2.blur=128;pano.blur=128,500" onTransitionEnd="pano2.blur=0,500">
<spot url="next.png" onClick="loadPano(panorama2.swf,1000,none);" />
</global>
onTransitionEnd event, fires when transition effect is over
This example demonstrates another transition effect (the first panorama goes to white, and then the second one appears from the light):
<global onTransitionStart="pano2.brightness=1;pano.brightness=1,800" onTransitionEnd="pano2.brightness=0,1000">
<spot url="next.png" onClick="loadPano(panorama2.swf,1000,none);" />
</global>
onActivate event, fires when panorama gets the keyboard focus
This example demonstrates "old photo effect" for the panorama if it's out of focus:
<global onDeActivate="saturation=- 1,400;brightness=0.4,400;" onActivate="saturation=0,400;brightness=0,400;" >
onDeactivate event, fires when panorama looses the keyboard focus
Note, panorama looses the keyboard focus when you switch to fullscreen mode in browser (for security restriction user has no keyboard
control in fullscreen mode; there is no problem for offline application). Update the previous example to avoid applying the effect in fullscreen
mode:
<global onDeActivate="saturation=- 1,400;brightness=0.4,400;" onActivate="saturation=0,400;brightness=0,400;"
onEnterFullscreen="onActivate()">
onEnterFullscreen event, fires when panorama enters the fullscreen mode
In this example the color of a button is changing depends on fullscreen mode:
<global onEnterFullscreen="full_btn.hue=0.5,1000" onExitFullscreen="full_btn.hue=0,1000" >
<spot id="full_btn" static="1" salign="RT" align="RT" url="full.jpg" onClick="fullscreen()" />
</global>
onEnterFullscreen event, fires when panorama exits the fullscreen mode
This is an example how to organize two buttons: "enter fullscreen" and "exit fullscreen":
<global onEnterFullscreen="enterButton.visible=0;exitButton.visible=1;"
onExitFullscreen="enterButton.visible=1;exitButton.visible=0;" >
<spot id="enterButton" static="1" salign="RT" align="RT" url="full.jpg" onClick="fullscreen()" />
<spot id="exitButton" static="1" salign="RT" align="RT" url="fullOut.jpg" visible="0" onClick="fullscreen()" />
</global>
onLoad event, fires for loaded spot object if spot hasn't it's own onLoad function
This function allows to apply the single onLoad effect for all spots in the application.
<global onLoad="alpha=0;alpha=1,1000" > (create onLoad effect: alpha transition from 0 to 1)
<spot id="pic1" url="picture1.jpg" pan="10" /> (this spot will appear slowly after loading)
<spot id="pic2" url="picture2.jpg" pan="20" /> (this spot will appear slowly after loading)
<spot id="pic3" url="picture3.jpg" pan="30" onLoad="" /> (this spot appears at once so it has it's own onLoad function disabling
global.onLoad)
onOver event, fires for spot object on mouse over if spot hasn't it's own onOver function
This function allows to apply the single onOver effect for all spots in the application.
onOut event, fires for spot object on mouse out if spot hasn't it's own onOut function
This function allows to apply the single onOut effect for all spots in the application.
<global onOver="scale=1.2,600,elastic;depth+=20" onOut="scale=1,300;depth=0" >
onPress event, fires for spot object on mouse press if spot hasn't it's own onPress function
This function allows to apply the single onPress effect for all spots in the application.
onRelease event, fires for spot object on mouse release if spot hasn't it's own onRelease function
This function allows to apply the single onRelease effect for all spots in the application.
<global onPress="staticX+=1;staticY+=2" onRelease="staticX-=1;staticY-=2" >
onClick event, fires for spot object on mouse click if spot hasn't it's own onClick function
This function allows to apply the single onClick effect for all spots in the application.
<global onClick="openUrl(http://you_forgot_onClick_event_for_this_button/)" >
openUrl opens new web URL
syntax: openUrl([url],[target])
[url] is target URL,
[target] (optional) is target window, default value is "_blank", use "_self" to open url in the same window.
onClick="openUrl(http://flashpanoramas.com/)" (opens http://flashpanoramas.com/ in the new window on mouse click)
loadPano loads new panorama images and appear them after loading.
loadPano([panorama], [time for transition effect], [transition effect])
[panorama] new panorama description,
[time for transition effect] (optional) is time for effect duration is milliseconds, default value is 1000.
[transition effect] (optional) is effect for panorama to appear (none, fade, stripes, coverDown and visible), default value is fade.
visible transition effect allows to watch the loading panorama during the loading process (you can use it together with loaderStreamed and
loaderBandwidth properties). Set transition time to 0 for visible effect.
The first argument of loadPano accepts string of parameters:
loadPano(panoName=nature) (loads panorama nature, nature_f.jpg, nature_r and so on by default)
loadPano(panoName=nature&panoType=mov) (loads panorama nature with type mov, i.e. file nature.mov; if you have the same pano
type for all panoramas in tour, you can omit this parameter, it will be took from the previous panorama)
loadPano(panoName=nature&pan=100&tilt=-10) (loads panorama with initial pan=100 and tilt=-10)
loadPano(panoName=panoramas/nature) (will load images panoramas/nature_f.jpg, panoramas/nature_r.jpg. This is a way to load
images from any relative or absolute path.
loadPano(panoName=panoramas/nature&panoSuffixes=1.png|2.png|3.png|4.png|5.png|6.png, 3000, stripes) (will load
panoramas/nature1.png, panoramas/nature2.png and so on using strips transition effect 3 seconds long)
It supports old format loading:
loadPano(nature.swf) (the same as loadPano(panoName=nature) command)
loadPano(nature.swf?pan=100) (the same as loadPano(panoName=nature&pan=100) command)
By default, no XML file be loaded, use direct indication if you want to load new parameters file:
loadPano(panoName=panoramas/nature&xml_file=nature.xml) (loads panorama with a new parameters file)
This action applies new panorama parameters from XML file, new limits parameters (if your file contains <limits></limits> section), new
autorotation parameter (<autorotator></autorotator>). Section <hotspots></hotspots> will be reload by default as well (all hotspots and
global parameters will be unloaded and new <hotspots></hotspots> XML will be placed). You can disable reloading of
<hotspots></hotspots> parameters using global.disableReloading=1 (it is useful if you have the same hotspots set for all panoramas in
tour and arbitrary tour's entry point).
fullscreen opens the panorama window fullscreen if Flash Player is in window mode, or changes the fullscreen mode back to normal view if
player is in fullscreen mode.
Syntax: fullscreen([url])
[url] is an optional parameter to open a new browser window if the fullscreen feature is unsupported (Flash Player with version less then
9,0,18,60 and greater then 9.0.0.0).
onClick="fullscreen()" switches screen mode, does nothing if Flash Player doesn't support fullscreen mode
onClick="fullscreen(pano/myPano.swf)" switches screen mode, if Flash Player doesn't support fullscreen mode it opens a new browser
window with indicated url ("pano/myPano.swf")
onClick="fullscreen(-)" switches screen mode, if Flash Player doesn't support fullscreen mode it opens a new browser window with
current document URL (window.location)
There is some words about security restrictions. Current version of Flash Player disables keyboard events for fullscreen mode in browser.
Also Flash Player can switch to fullscreen mode only if user clicks mouse inside the Flash Player window, so don't use fullscreen command
with onLoad event or with onOver event, attach it only to the onClick event.
javascript: runs javascript commands
You can use it to open new popup windows (a way to avoid popup blockers) and to run any external Javascript functions:
onClick="javascript:window.open('http://flashpanoramas.com/','windowID','menubar=1,resizable=1,width=900,height=400');void(0);"
panorama to increase motion smoothness, sets best segmentation quality 30 when drag operation is done)
sensitivity changes mouse sensitivity
<spot url="up.jpg" onClick="pano.sensitivity+=5" /> (increases mouse sensitivity by 5 on click)
<spot url="down.jpg" onClick="pano.sensitivity-=5" /> (decreases mouse sensitivity by 5 on click)
keySensitivity changes keyboard sensitivity
<global onStart="pano.keySensitivity=50" /> (sets keySensitivity to 50 on application start)
friction changes friction coefficient
<global onTransitionStart="pano.friction=0.5" onTransitionEnd="pano.friction=0.9" /> (increases the friction while transition effect is
in process to slow down the panorama motion and make tranition effect more smooth)
threshold changes threshold value of panorama
<global onStart="pano.threshold=0.000000001" /> (sets threshold to 0.000000001)
pan_v changes panning speed of panorama
<global onStart="pano.pan_v=0.1" /> (gives a horizontal push to the panorama at start)
tilt_v changes tilting speed of panorama
<spot url="up.jpg" onClick="pano.tilt_v+=0.1" /> (increases vertical speed on click)
zoom_v changes zooming speed of panorama
<spot url="go1.jpg" onClick="stopPano();goPoint1()" stopPano="pano.pan_v=0;pano.tilt_v=0;pano.zoom_v=0;"
goPoint1="pano.pan=140,3000;pano.tilt=50,3100" /> (stops the panorama motion before make a smooth transition to point {140,50} to
avoid motion tween interruption).
panKey emulates key press for panorama
panKey=1 is equivalent of pressing right key button, panKey=-1 is the same to left button press.
<spot url="right.jpg" onPress="pano.panKey=2" onRelease="pano.panKey=0" /> (emulates right key press but with double speed)
tiltKey emulates key press for panorama
panKey=1 is equivalent of pressing right key button, panKey=-1 is the same to left button press.
<spot url="diag.jpg" onPress="pano.panKey=1;pano.tiltKey=1;" onRelease="pano.panKey=0;pano.tiltKey=0" /> (makes a diagonal
button, to move the panorama to right-top direction)
zoomKey emulates key press for panorama
panKey=1 is equivalent of pressing right key button, panKey=-1 is the same as left button press.
<spot url="zoomin.jpg" onPress="pano.zoomKey=3,1000" onRelease="pano.zoomKey=0" /> (emulates zoom in button but with
smooth factor acceleration)
behaviour changes panorama behaviour
<spot onClick="pano.behaviour=0"/> (changes the panorama behaviour to the simple "press and drag" mode)
qualityMotion changes antialiasing quality when panorama is moving
Note, qualityMotion param applies only if the panorama is moved by internal engine (on mouse/keyboard interaction and on pan_v, tilt_v,
zoom_v, panKey, tiltKey, zoomKey changes). But if you move it changing pan/tilt values directly (pano.pan=40,1000) panorama stays in
qualityStatic mode.
qualityStatic changes antialiasing quality when panorama stills
<spot url="go1.jpg" onClick="stopPano(); pano.qualityStatic=low; goPoint1()"
stopPano="pano.pan_v=0;pano.tilt_v=0;pano.zoom_v=0;" goPoint1="pano.pan=140,3000;pano.tilt=50,3100" /> (stops the panorama
motion and change the antialiasing quality to low before make a transition to point {140,50}; provides the most smooth and quick motion
tween).
leash is a special parameter to set type of link between old and new loaded panoramas
This parameter determines how panorama positions interact after the new panorama is loaded (using loadPano command) and before the
previous panorama will be removed.
Possible values:
lock - the new panorama has the same pan/tilt/zoom parameter
follow - the new panorama has it's own pan/tilt/zoom but all changes of pan/tilt/zoom during a transition effect change new pano
parameters.
free - pan/tilt/zoom calculates independently for both panoramas
Default value is lock.
Use lock if you want to load the panorama pixel-to-pixel with previous one (transition from a preview to full size panorama, panoramas with
equivalent set of hotspots and the like), use follow or free if you want to be sure that your new panorama will be loaded with it's own initial
pan/tilt/zoom.
<pano leash="follow" /> (sets follow type of leash between panoramas for all loadPano commands)
<spot url="pano2.jpg" onClick="pano.leash=free;loadPano(pano2.swf)" (sets leash parameter to free before loading pano2.swf)
disableKeys disables/enables keyboard events for panorama engine
<pano disableKeys="1" /> (disables keyboard interaction for panorama)
<spot url="enable.gif" onClick="disableKeys=0" /> (enables keyboard interaction for panorama on this spot click)
disableWheel disables/enables mouse wheel support for panorama engine
<pano disableWheel="1" /> (disables mouse wheel for panorama)
<spot url="enable.gif" onClick="disableWheel=0" /> (enables mouse wheel for panorama on this spot click)
disableControls disables/enables mouse and keyboard support for panorama engine
<spot url="go1.jpg" onClick="stopPano(); pano.qualityStatic=low; pano.disableControls=1; goPoint1()"
stopPano="pano.pan_v=0;pano.tilt_v=0;pano.zoom_v=0;" goPoint1="pano.pan=140,3000;pano.tilt=50,3100,,enableControls"
enableControls="pano.disableControls=0;" /> (stops the panorama motion and change the antialiasing quality to low before make a
transition to point {140,50}, set disableControls=1 to be sure that user can't interrupt the motion tween, restore controls after transition is
done).
disableTilt disables/enables mouse wheel support for panorama engine
<pano disableTilt="1" /> (disables tilt for the panorama)
disablePan disables/enables mouse wheel support for panorama engine
<pano disablePan="1" /> (disables pan for the panorama)
onPress event, fires on panorama press
It fires when user starts to drag the panorama. This event fires as well when user press the spot with default values of buttonMode and
blockMouse (spots are transparent for panorama drag event by default). Use buttonMode="0" or buttonMode="1" and blockMouse="1"
together to prevent panorama drag through the spot object.
<pano onPress="saturation=2" onRelease="saturation=0" /> (saturate colors of the panorama on drag)
onRelease event, fires on panorama release
It fires when user finish to drag the panorama.
<pano onRelease="friction=1;pan_v*=-0.5,100,bounce; tilt_v*=-0.5,100,bounce,restoreFriction;" restoreFriction="friction=0.9" />
(make some funny "repulsion" effect on release event)
onKeyPress event, fires when one of keyboard control button is pressed
It ignores buttons except panorama control buttons (left, right, up,down, zoomin, zoomout, home and hold). This can be used to track the
keyboard activity.
This example demonstrates how to organize some complex automatic motion through the set of panorama points and restart it every time
on user inactivity:
<global onStart="pano.goTimer()" (starts wait timer on the beginning)
<pano
onRelease="goTimer()" (restarts wait timer when user stops to drag the panorama)
onKeyPress="goTimer()" (restarts wait timer when user stops to drag the panorama)
goTimer="timer+=1,20000,,go1; qualityStatic=medium" (waits 20 seconds of keyboard and mouse inactivity, call function go1 after that )
go1="pan=100,1900;tilt=-20,2000,,pause1; qualityStatic=low" (moves to the first point on the panorama, use low quality to make it more
smooth, call pause1 on motion done)
pause1="timer+=1,1000,,go2; qualityStatic=medium" (restores quality, makes a pause before next point transition, then call go2 function
)
go2="pan=150,1900;tilt=0,2000,,pause2; qualityStatic=low" (moves to the second point on the panorama)
onPress="timer=0" (stops timer if user presses left mouse button on the panorama)
/>
Make as many as you want points (go1, go2, go3 and so on) to make an arbitrary motion path, last function can call go1 function to close
the trip and make it infinite until user clicks a mouse button or press one of the keyboard control button.
<spot url="spot.jpg" scaleX="0.5" onClick="scaleX=2,300,bounce;" /> (sets the initial scaleX value to 0.5, defines quick (300
milliseconds) bounce effect increased the horizontal scale to 2 on mouse click)
scaleY vertical scale factor
scaleY=1 is original size of the hotspot image, scaleY=-1 makes vertical flip. Default value is 1.
<spot url="spot.jpg" scaleY="0.5" onClick="scaleY=2,300,bounce;" /> (sets the initial scaleY value to 0.5, defines quick (300
milliseconds) bounce effect increased the vertical scale to 2 on mouse click)
rotation rotation of hotspot image in degrees
Possible values: [-180, 180]. All other values will be reduced to this range. Default value is 0.
<spot url="1.jpg" onClick="rotation=1080,3000,regular" /> (rotates the hotspot 3 times clockwise in 3 seconds with constant velocity)
alpha coefficient of transparency
Valid values are 0 (fully transparent) to 1 (fully opaque). Default value is 1. Hotspot objects with alpha set to 0 can take mouse events, even
though they are invisible.
<spot url="1.jpg" onClick="alpha=0,3000" /> (makes slow fade out on click)
staticX X position of hotspot relative to alignment point, works together with static parameter
It determines the distance between the center point of hotspot and the window alignment point in pixels. Use it to make some margins for
statically aligned hotspots.
Default value is 0.
<spot url="1.jpg" static="1" align="RB" salign="RB" staticX="-4" staticY="-4" /> (aligns the hotspot to the right-bottom corner with 4
pixels indent)
staticY Y position of hotspot relative to alignment point, works together with static parameter
It determines the distance between the center point of hotspot and the window alignment point in pixels. Use it to make some margins for
statically aligned hotspots.
Default value is 0.
<spot url="1.jpg" static="1" staticY="100" /> (aligns the hotspot to 100 pixels below the center of the panorama)
alignX horizontal alignment
Can be used to change the hotspot align point with motion tween or to set the hotspot align point to any custom position.
Setting of align property changes alignX value (L gives 0, C gives -0.5, R gives -1).
<spot url="me.jpg" id="s2" onOver="s1.rotation=160, 1500, elastic; s1.alignX=-0.1,3000, elastic;" onOut="s1.rotation=0, 1000,
elastic; s1.alignX=-0.5,3000, elastic;" /> (makes some funny diving-like motion for hotspot s1 using roll over event of the hotspot s2)
alignY vertical alignment
Can be used to change the hotspot align point with motion tween or to set the hotspot align point to any custom position.
Setting of align property changes alignY value (T gives 0, M gives -0.5, B gives -1).
<spot url="me.jpg" alignX="-2" alignY="-2" /> (sets the hotspot align point outside of object)
salignX horizontal window alignment, works together with static parameter
Can be used to change the window align point with motion tween or to set the window align point to any custom position.
Setting of salign property changes salignX value (L gives -0.5, C gives 0, R gives 0.5).
<spot url="me.jpg" static="1" salign="RB" align="RB" onClick="alignX=0,1000;alignY=1,1000;salignX=0.5,1000;salignY=0.5,1000;" /> (moves static hotspot object form the right-bottom corner to the left-bottom corner on
mouse click)
It determines the distance between the center point of hotspot and the window alignment point in pixels. Use it to make some margins for
statically aligned hotspots.
Default value is 0.
<box url="1.jpg" static="1" staticY="100" /> (aligns the hotspot to 100 pixels below the center of the panorama)
alignX horizontal alignment
Can be used to change the hotspot align point with motion tween or to set the hotspot align point to any custom position.
Setting of align property changes alignX value (L gives 0, C gives -0.5, R gives -1).
<box url="me.jpg" id="s2" onOver="s1.rotation=160, 1500, elastic; s1.alignX=-0.1,3000, elastic;" onOut="s1.rotation=0, 1000,
elastic; s1.alignX=-0.5,3000, elastic;" /> (makes some funny diving-like motion for hotspot s1 using roll over event of the hotspot s2)
alignY vertical alignment
Can be used to change the hotspot align point with motion tween or to set the hotspot align point to any custom position.
Setting of align property changes alignY value (T gives 0, M gives -0.5, B gives -1).
<box url="me.jpg" alignX="-2" alignY="-2" /> (sets the hotspot align point outside of object)
salignX horizontal window alignment, works together with static parameter
Can be used to change the window align point with motion tween or to set the window align point to any custom position.
Setting of salign property changes salignX value (L gives -0.5, C gives 0, R gives 0.5).
<box url="me.jpg" static="1" salign="RB" align="RB" onClick="alignX=0,1000;alignY=-1,1000;salignX=0.5,1000;salignY=0.5,1000;"
/> (moves static hotspot object form the right-bottom corner to the left-bottom corner on mouse click)
salignY vertical window alignment, works together with static parameter
Can be used to change the window align point with motion tween or to set the window align point to any custom position.
Setting of salign property changes salignY value (T gives -0.5, M gives 0, B gives 0.5).
<box url="me.jpg" id="s1" static="1" salignX="-0.25" salignX="-0.25" /> (places hotspot object to 1/4 from the panorama window lefttop corner)
refreshRate refresh rate for distorted hotspot update
The number defines how many times in second the picture for distorted hotspot is refreshed.
Possible values is 0 and more.
Default value is 0.
<box url="me.jpg" pan="45" orientation="front" /> (do not set refreshRate for static images, there is nothing to update)
<box url="me.swf" pan="45" refreshRate="0.5" /> (for slow animation in swf file, use slow refreshRate. Value 0.5 means one refresh in 2
seconds)
<box url="flvplayer?file=me.flv" pan="45" refreshRate="20" /> (use refreshRate in compliance with video refresh rate)
<box url="flvplayer?file=me.flv" pan="45" refreshRate="20" onClick="distorted=0;refreshRate=0" /> (when you switch a hotspot in
live mode there is a sense to remove refreshRate)
shrink quality reduce factor for distorted image
Possible values is 1 and more.
Default value is 1 (no quality reduce).
Use this value if you have a big hotspot image mapped to a small area, this can increase performance noticeable (i.e. if you have, say,
800x600 image, but image area on the panorama is about 100 pixels width, use shrink=8)
<box url="photo.jpg" shrink="8" onOver="scale=4;shrink=1" onOut="scale=1;shrink=8" /> (you can change shrink parameter at
Note, soundPan can't change the sound level of dynamic sounds (attachSound() function in Flash). If you have a dynamic sound, you need
to organize a transfer of Flash soundTransform object from hotspot movie to dynamic sound, check plugins/flvplayer.fla (Flash CS3 file
format) for this functionality.
id identifier of the hotspot
identifier can contain any Latin symbols and numbers. Use different identifiers for hotspots, do not use reserved identifiers pano, pano2 and
global. Id parameter is not case sensitive.
<box id="123abc" url="myImage.jpg" /> (gives 123abc identifier to this hotspot)
<box url="myImage.jpg" /> (you can omit id parameter in hotspot tag, it will be generated automatically, but in this case you will not be
able to address this hotspot from other objects)
<box id="box10" url="box.jpg" onClick="id=spot55" /> (id can be changed dynamically)
<box url="box.jpg" onClick="id=" /> (assigning empty string value to the hotspot id unloads the hotspot completely)
url absolute or relative path to image or any Flash movie
This parameter specifies an external file to be loaded inside a hotspot object. It can be an image in jpg, gif or png format or a swf Flash
movie of any version of Flash Player).
<box url="images/spot1.png" /> (loads an image images/spot1.png)
<box url="http://www.mydomain.com/movie.swf" /> (loads a Flash movie using absolute path)
<box id="video" url="http://www.youtube.com/v/8nyYloJyq9M" scaleable="1" scale="0.5" /> (loads external stream video inside a
hotspot)
Simple swf movies (videos, animations, simple presentations) can be loaded inside Flash Panorama Player without any problem. The
capacity for work of a complex external Flash application within Flash Panorama Player environment depends on the application
architecture. Correctly programmed Flash application can be loaded and shown ok with a high probability.
<box url="box1.jpg" onClick="url=spot2.jpg" /> (can be used to reload external file dynamically)
<box url="box1.jpg" onClick="url=" /> (set url to empty string to unload external file)
linked list of panoramas where hotspot is loaded
This is the way to organize automatic loading/unloading for hotspot images depends of loaded panorama image.
<box url="box1.png" linked="nature" /> (this hotspot is loaded for panorama with panoName=hall only)
<box url="box1.png" linked="nature|wood|snow" /> (use | as a separator to specify more then one linked panorama images)
When linked name is different from the current panoName, a hotspot object doesn't load image, doesn't take processor time, takes only a
few kilobytes in memory, but you can address any parameter of the hotspot object.
Spots which are not linked to new loaded panorama unload which transition effect start, hotspots which are linked to new panorama image
start loading images (url parameter) just after transition effect end.
Default value is empty string (spot image is loaded for any panorama image).
This is an example how to use linked parameter to implement a simple virtual tour with different sets of hotspots for every location:
<global onLoad="alpha=0;alpha=1,1000">
<pano leash="follow" />
<box id="logo" url="logo.swf" static="1" salign="RB" align="RB" onClick="openUrl(http://flashpanoramas.com/)" />
<box id="lobby1" url="arrow.jpg" linked="lobby" onClick="loadMovie(hall.swf);" />
<box id="lobby2" url="arrow.jpg" linked="lobby" onClick="loadMovie(kitchen.swf);" />
<box id="hall1" url="arrow.jpg" linked="hall" onClick="loadMovie(balcony.swf);" />
<box id="hall2" url="arrow.jpg" linked="hall" onClick="loadMovie(lobby.swf?pan=180);" />
<box id="kitchen" url="arrow.jpg" linked="kitchen" onClick="loadMovie(lobby.swf?pan=-90);" />
<box id="balcony" url="arrow.jpg" linked="balcony" onClick="loadMovie(hall.swf?pan=120);" />
</global>
Spots lobby1 and lobby2 have parameter linked="lobby" so they will be loaded at start and stay loaded until user clicks one of these
hotspots. Hotspots hall1 and hall2 linked to hall.swf panorama. The first hotspot hall1 guides to new place balcony.swf, the second one
guides back to lobby.swf but with some additional rotation: lobby.swf?pan=180 to make a feeling that we are entering from the opposite
side. Hotspots kitchen and balcony works analogously. Hotspot logo has no linked parameter and therefore it is visible for all locations.
Note, if you are using some complex panoName: loadPano(?panoName=panos/home/lobby), specify the full path in linked parameter:
linked="panos/home/lobby".
unlinked list of panoramas where hotspot is not loaded
This parameter supplement linked param. Specify all panorama names separated with "|" and they will be automatically unloaded for
indicated panoramas:
<box url="box1.png" unlinked="nature|snow" /> (this hotspot is not loaded for panoramas with panoName=nature and
panoName=snow)
visible visibility of hotspot
This parameter determines whether or not the hotspot is visible.
Correct values are 0 and 1. Default value is 1. You can't click hotspot with visible=0.
<box url="box1.jpg" onClick="visible=0" /> (hides hotspot)
<box url="box1.jpg" onClick="anotherSpot.visible+=1" /> (switches visibility of hotspot anotherSpot)
distorted enables distortions of box object
This parameter determines whether or not the hotspot is distorted.
Value 1 means that hotspot is distorted and can be placed in virtual 3D in any position.
Value 0 means that hotspot is not distorted (its behaviour is equivalent to spot object). You can interact with swf applications in this mode.
Default value is 1.
<box url="app.swf" onClick="distorted=0" /> (changes the default distorted value to 0 on mouse click)
orientation defines the basic orientation of hotspot
Possible values:
cylinder - hotspot stays parallel to vertical cylinder surface around the panorama (hotspot looks smaller with tilt deviation).
sphere - hotspot stays parallel to panorama sphere surface (always the same size and always in front of observer)
front - hotspot stays parallel to front (back) side of panorama cube.
back - hotspot stays parallel to back (front) side of panorama cube.
left - hotspot stays parallel to left (right) side of panorama cube.
right - hotspot stays parallel to right (left) side of panorama cube.
up - hotspot stays parallel to top (bottom) side of panorama cube.
down - hotspot stays parallel to bottom (top) side of panorama cube.
Default value is cylinder.
This property is useful if you want to place several elements on the same surface or to make some motion across this surface.
For example, if you want to place several images on the wall parallel to front side of panorama cube, place the first image to the wall and
find the appropriate scale for it:
<box url="img1.jpg" pan="0" tilt="10" orientation="front" scale="0.4" />
Now you can place other images on the same surface changing only pan and tilt values (remoteness will be calculated automatically for
most natural look):
<box url="img2.jpg" pan="20" tilt="10" orientation="front" scale="0.4" />
<box url="box.jpg" buttonMode="0" /> (disables hand cursor for this hotspot)
enableSoundPanning enables sound pan changing on panorama motion
Default value is 0 (no panning effect).
<box url="music.swf" enableSoundPanning="1" /> (enables panning effect for this hotspot)
Note, enableSoundPanning can't change the sound effect of dynamic sounds (attachSound() function in Flash). If you have a dynamic
sound, you need to organize a transfer of Flash soundTransform object from hotspot movie to your dynamic sound, check
plugins/flvplayer.fla (Flash CS3 file format) for this functionality.
onLoad event, fires when hotspot external file loading is complete
<box url="box.jpg" onLoad="alpha=0;alpha=1,1000" /> (fades in loaded hotspot)
onOver event, fires on mouse over
<box url="box.jpg" onOver="rotation+=90,800" /> (rotates the hotspot by 90 degrees for every mouse roll over)
onOut event, fires on mouse out
<box url="box.jpg" onOver="rotation+=90,800" onOut="rotation-=90,800" /> (rotates the hotspot by 90 degrees for every mouse roll
over, rotates the hotspot by -90 for every mouse roll out)
onPress event, fires on mouse press
<box url="up.jpg" onPress="pano.brightness+=0.05" /> (increases panorama brightness by 5 for every mouse press)
onRelease event, fires on mouse release
<box url="box.jpg" onPress="pano.panKey=2,500,,,shortClick" onRelease="pano.panKey=0" shortClick="pano.pan_v=0.1" />
(emulates right key button: moves panorama smoothly for a long button press and makes a quick panorama shift for short clicks)
onClick event, fires on mouse click
<box url="box.jpg" onClick="openUrl(http://flashpanoramas.com/" /> (opens new URL on click)
Offline panoramas
Now we are ready to create an offline presentation.
1. Download Flash Player 9 Standalone player (projector) for your OS from here:
http://www.adobe.com/support/flashplayer/downloads.html.
2. Run the Standalone Player and open your main panorama file (drag it to the Standalone Player window). I
used nature.swf:
I have six images (cube faces), autorotator.swf to make panorama to rotate automatically,
SAFullscreen.swf plugin (a simple plugin to open Standalone Player window fullscreen - take it from the
plugins folder), nature.xml with params and Nature.exe - standalone variant of the Flash Panorama Player.
I do not need any other files.
6. nature.xml contains:
<?xml version="1.0" ?>
<panorama>
<parameters>
layer_1=SAFullscreen.swf
layer_2=autorotator.swf
</parameters>
</panorama>
One last step: I'm going to create an autorun file (for Windows). I want to burn my panorama to CD and I
want to make it starts to show the panorama when I insert this disc into the CD-ROM drive.
7. Create new text file and rename it to autorun.inf:
Benefits
No Flash experience is required. You can create your panorama exhibitions using simple text editor.
Full multiplatform support. Works the same for Windows, Mac and Linux.
Understands jpg, png, gif, swf and mov file formats.
Supports QTVR files, separate cube faces, cube stripes, spherical and cylindrical images.
Can be used to create both online and offline applications. Can be converted to standalone application.
Can be embedded to any HTML or Flash site (Flash site should be compiled as Actionscript 3 application).
The panorama player is fully customizable, you can change scores of parameters, you can draw your own
controls and buttons.
Using Actionscript you can write new plugins for the player, create new transition effect, load the player to
other Flash/Flex/AIR applications.
All Flash Panorama Player updates (including panorama engine updates and new plugins) are free for
Flash Panorama Player customers.
Using parameters
How to pass parameters to the player
1. Query string
2. Flashvars
3. SWFObject
4. Additional XML file
5. Embedded XML file
Parameters description
1. Image loader params (panoName, panoType, panoSuffixes, image_f, image_r, image_b, image_l, image_u, image_d, loaderTextColor,
loaderBackColor, transparentBack, loaderText, loaderTextDenied, loaderTextFailed, loaderAttempts, loaderConsecutive,
loaderStreamed, loaderBandwidth, policyFile, allowDomain, disableLoading)
2. Visualization params (segments, shrink, qualityMotion, qualityStatic, zoomMax, zoomMin, zoomHome, panHome, tiltHome, zoom, pan,
tilt, hfov, vfov, ratio, frameRate)
3. Controller params (behaviour, sensitivity, keySensitivity, friction, threshold, keys, disableKeys, disableTilt, disablePan, disableWheel,
disableControls)
4. Plugins loader (layer_N parameter).
Flashvars
The same as query string but using a special property in OBJECT/EMBED tag:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="550" height="400" id="pano1"
align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="pano.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="flashvars" value="panHome=180&tiltHome=-20" />
<embed src="pano.swf" quality="high" bgcolor="#ffffff" flashvars="panHome=180&tiltHome=-20" width="550" height="400" name="mymovie"
align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
Read more about using Flashvars property here: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_16417
SWFObject
More reliable way to embed a Flash movie in html is SWFObject.
It uses a special function addVariable to pass parameters to the Flash movie:
<script type="text/javascript">
var so = new SWFObject("pano.swf", "mypano", "600", "400", "9", "#FFFFFF");
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.addVariable("panoName", "images/pano1");
so.addVariable("sensitivity", "50");
so.addVariable("keySensitivity", "50");
so.write("flashcontent");
</script>
or if you are using Flash version detector plugin:
<script type="text/javascript">
var so = new SWFObject("show_pano.swf", "mypano", "600", "400", "6.0.65", "#FFFFFF");
so.addParam("allowFullScreen","true");
so.addParam("allowScriptAccess","sameDomain");
so.addVariable("movie", "pano.swf");
so.addVariable("panoName", "images/pano1");
so.addVariable("sensitivity", "50");
so.addVariable("keySensitivity", "50");
so.addVariable("redirect", window.location);
so.write("flashcontent");
</script>
param file.
Parameters description
Image loader params
panoName sets the panorama identifier
This is a panorama identifier. It determines the path to panorama images.
panoName=myPano tells the player to load images myPano_f.jpg, myPano_r.jpg, myPano_b.jpg, myPano_l.jpg, myPano_u.jpg, myPano_d.jpg.
It can contain a path to the panorama (panoName=images/pano/mypano, panoName=../path2/mypano).
Default value (if you started the player without panoName parameter) is the name of swf file without ".swf" (nature.swf -> nature).
panoType sets the panorama type
It provides the panorama type for the player. It also determines the default suffixes for panorama images. Possible values:
cube (default) will load cube faces with suffixes: _f.jpg, _r.jpg, _b.jpg, _l.jpg, _u.jpg, _d.jpg.
cube0 will load cube faces with suffixes: _0.jpg, _1.jpg, _2.jpg, _3.jpg, _4.jpg, _5.jpg.
cube1 will load cube faces with suffixes: _1.jpg, _2.jpg, _3.jpg, _4.jpg, _5.jpg, _6.jpg.
stripe will load one image with suffix: .jpg. Will convert it to 6 cube faces after loading.
cylinder will load one image with suffix: .jpg. Will convert it to 6 cube faces after loading using spherical/cylindrical projection. Requires cylConverter.swf
plugin.
mov will load QTVR file with suffix: .mov. Requires movDecode.swf plugin. Requires cylConverter.swf plugin as well for cylindrical QTVR panoramas.
panoSuffixes sets the suffixes to derive image URLs
Visualization params
segments defines the number of pieces for each image
segments=25 means that each image will be divided into 25*25=625 pieces (6*625=3750 polygons for panorama in total) which could be rotated in 3D
space.
This param determine the quality of the panorama rendering (the more pieces the image is divided, the better quality the panorama is).
On the other hand this parameter affects to panorama rotation speed and smoothness.
segments=10 provides low interpolation quality (straight lines on the panorama may look wavy) but it requires less processor power and therefore it
produces a fast and smooth rotation even for slow and old computers.
segments=20 provides good interpolation quality and smooth enough motion.
segments=30 provides the best image quality, use it for quality and fullscreen panoramas. Can be slow for weak computers.
segments=40 and more is for quality gourmets.
Default value is 20. Minimal value is 10.
shrink makes dynamic resolution reduction for panorama images
This feature allows to save RAM and run big panoramas on slow computers.
shrink=3 means that resolution of loaded images will be divided by 3. It reduces the required RAM by a factor of 9.
Default value is 1 (no shrinking).
qualityMotion determines the antialiasing value when user drags the panorama
qualityStatic determines the antialiasing value if user does not move the panorama
Possible values: low (no antialiasing), medium, high and best (maximal smoothing).
Use qualityMotion=low to make the panorama motion quick and smooth, use qualityStatic=medium to avoid cogged lines in the static position, use
qualityStatic=high or best for big and quality panoramas with many small details.
Default value for qualityStatic is medium; default value for qualityMotion is low.
Controller params
behaviour determines how panorama interacts with the mouse movements
behaviour=0 means you can simply drag your panorama,
behaviour=1 gives a smooth motion when the user holds and shifts your mouse,
behaviour=2 provides a smooth motion with inertia effects. Inertia effects apply to all keyboards movements as well.
Use behaviour=-1 to disable any interaction.
Default value is 2.
sensitivity sets the mouse sensitivity
Default value is 10 (slow and smooth movement).
keySensitivity sets the sensitivity for keyboard movement
Default value is 10 (slow and smooth movement).
friction sets the coefficient of deceleration for panorama motion (works together with behaviour=2)
friction=1 prevents any inertia effects.
friction=0 means no friction, move panorama once and it will move infinitely.
Default value is 0.9.
threshold sets the threshold of motion speed (works together with behaviour=2)
This parameter determines the order of values when motion calculations stops and panorama goes to the static mode.
Default value is 0.0000001.
keys can change the keyboard codes for active buttons
Use "|" to separate code numbers. order of codes is: "right key|left key|up key|down key|zoom in key|zoom out key||home key|hold key".
Default value is 39|37|38|40|16|17|36|32.
disableKeys is used to disable the keyboard events
Use disableKeys=1 if you want to disable the keyboard support.
Default value is 0.
disableTilt is used to forbid to tilt the panorama
Use disableTilt=1 if you want to restrict the panorama vertical rotation.
Default value is 0.
disablePan is used to forbid to panning the panorama
Use disablePan=1 if you want to restrict the panorama horizontal rotation.
Default value is 0.
disableWheel is used to disable the mouse wheel for zoom navigation
Use disableWheel=1 if you want to disable the mouse wheel actions.
Default value is 0.
disableControls is used to disable mouse and keyboard interaction with a panorama
Use disableControls=1 to deactivate both mouse and keyboard.
Default value is 0.
Plugins loader
layer_1, layer_2, layer_3 and so on are used for loading of external modules
Any number of external plugins can be attached to the panorama. Read Using plugins tutorial to learn more about this technique.
Example: layer_1=autorotator.swf
Plugin with the greater layer number appears higher in the player window.
All plugins are loading before the panorama images.
Using plugins
Plugins are external modules in swf format to extend functionality of the Flash Panorama Player.
Hint: you can do right-click, select in the context menu new -> Text Document and then rename it to
nature.xml.
2. Now open this empty file in Notepad (or use any other text or XML editor), write these lines:
<?xml version = '1.0'?>
<panorama>
<parameters>
layer_1 = fps.swf
</parameters>
</panorama>
You can read about the xml data format in this tutorial: Using parameters.
3. Save the file.
4. Copy file fps.swf from the plugins folder of the Flash Panorama Player package to your working
directory, like this:
5. Now run nature.swf, you can see something new in the top-left corner of the panorama:
fps.swf is very simple plugin showing frames-per-second counter, just a small tool to test performance of the
panorama.
unique number.
Tag <autorotator> provides the possibility to customize autorotation settings. You can change parameters
speed (speed of rotation in degrees), interval (redrawing interval in milliseconds), pause (time of inactivity in
millisecond after which autorotation begins) and quality (antialiasing mode: low, medium, high or best).
9. Now you can run nature.swf application again.
Simple tutorial
1. Extract files from the Flash Panorama Player package:
Notice: file names have standard format [pano name][side suffix].jpg (most of stitcher programs using it),
where [pano name] is a panorama name and the [side suffix] can be one of the following: _f - front side,
_r - right, _l - left, _b - back, _u - up, _d - down.
If your files have the other widespread name format with _0, _1, _2, _3, _4, _5 suffixes, use pano0.swf file
instead. Use panoStripe.swf if you have a single image with six cube faces within ("stripe" format).
4. Now rename pano.swf player file to [pano name].swf. For example, the panorama name is "nature", so
the player name should be nature.swf:
Actually, this is it. We linked panorama pictures with the Flash Panorama Player application with only several
clicks!
5. Double click nature.swf or drag it to your favourite browser:
Your browser should have Adobe Flash Player 9 plugin installed. This is the only requirement. Right-click the
flash movie to check your player version.
Parameters description
image_f sets front side image URL
image_r sets right side image URL
image_b sets back side image URL
Default value is 0.
layer_1, layer_2, layer_3 and so on, are used for loading of external modules.
Any number of external plugins can be attached with the help of these parameters. Read Using plagins
tutorial to learn more about this technique.
Example: <param name="layer_1" value="autorotator.swf" />
Plugin with the greater layer number appears higher in the player window.
policyFile is used to load the policy file before the images.
Use it to place the player file to the one domain and to load panorama images from another.
Read this document to get to know more about Flash Player 9 security:
http://www.adobe.com/devnet/flashplayer/articles/flash_player_9_security.pdf