that means:
1. move the looking position to 0/0 with a field of view of 50°
2. move the looking position to 45/-10 with a field of view of 70°
3. zoom to field of view of 150°
4. load the "next.xml" panorama
that means:
1. move/zoom smoothly to position 88.517/1.097 with a field of view of 6°
2. load "next.xml", keep current settings, don't load the preview from "next.xml",
overblend in 1 second
3. set current view to 180.8/1.9 with a field of view of 22°
4. wait until loading and blending have finished
5. move and zoom smoothly to 263.711/0.982 with a field of view of 87°
NEW in version 1.0.5 and higher:
Now the actions after a loadpano call are processed too!
So the onstart parameter of the loadpano call must not be used anymore!
This makes the code a better readable.
The same example as above now: (the difference is marked red)
parameters* (optional)
optional parameters for the action
this parameters replace the %N placeholders in the action tag
e.g.:
first parameter replaces the %1 in the action
second parameter replaces the %2 in the action
and so on...
example - zoom to a position, load and blend to the next pano, look to a new position
UPDATE NOTES 1.0.7 - functions can now also be called direct, without call()
e.g. just:
plugin[maps].pantospot(spot1);
instead of:
call(plugin[maps].pantospot,spot1);
- call a flash "action script 3" function
- this function can be a predefined function or
- it can be assigned from a plugin
- can be used to communicate from xml to plugins/as3 functions
parameters:
path
path to the function
e.g.
"plugin[image].changeorigin"
parameters* (optional)
optional parameters for the function
the parameters are passed as strings to the as3 function
example - change the origin position of a plugin but keep the current position at screen
switch(plugin[button1].alpha,1,0.5);
- switches the alpha value between 1 and 0.5
push(variable)
pop(variable)
push - saves the value of "variable" to stack
pop - restores the value of "variable" from stack
NOTE: stack is based on the principle of Last In First Out (LIFO)
showtext(text,textstyle*)
shows the "text" at the current mouse position or on screen coordinates
parameters:
text
the text to show
html tags can be used in the text
but using html characters like '<' and '>' is not possible!
use '[' and ']' instead of it
for language specific characters use a set the Encoding of XML file or use a Unicode UTF8 or UTF16 XML file
NOTE - to use some special characters like ',' or '<' and '>' they
needed to be escape-coded in form %HH, where HH is the hex code of the character.
e.g.: ',' = %2C
for linebreaks just use [br] (=<br>) or '\n'
examples tags for formating:
[b]bold[/b]
- bold text
[i]italic[/i]
- italic text
[u]underline[/u]
- underlined text
[br]
- linefeed
textstyle (optional)
the name of the textstyle to use for this text,
if not defined the DEFAULT style is used see xml textstyle tag documentation
motiontype (optional)
can be: linear(speed) - linear movement
- speed = moving speed in degrees/second
smooth(accel,break,maxspeed) - accelerated smooth movement (=default)
- accel = acceleration in degrees/second² (default=720)
- break = negative acceleration in degrees/second² (default=-720)
- maxspeed = maximum moving speed in degrees/second (default=720)
examples:
moveto(100.0,5,linear(10));
zoomto(130,smooth());
lookto(33,-22,30,smooth(100,50,20));
looktohotspot(hotspotname,fov*,motiontype*)
moves the view to the center of the hotspot
parameters:
hotspotname
name of the hotspot
fov (optional)
destination field of view
can be "auto" or a value from 1 .. 179°
default is "auto" - there the fov is calculated from the size of the hotspot
motiontype (optional)
can be: linear(speed) - linear movement
- speed = moving speed in degrees/second
smooth(accel,break,maxspeed) - accelerated smooth movement (=default)
- accel = acceleration in degrees/second² (default=720)
- break = negative acceleration in degrees/second² (default=-720)
- maxspeed = maximum moving speed in degrees/second (default=720)
- changes the value of an API variable in intervals
- it interpolates from the start value to an destination value
- if a other timerset/tween is already modifying the same value it will be stoped
parameters:
seconds
time to run in seconds, default=0.5
it is possible to use here a special function that calculates the time depending on the
distance between the start and destination value:
distance(maxdistance,maxtime)
maxdistance - the maximum distance between start and destination values
maxtime - the time in seconds for this maximum distance
now depending on the current value/position the needed time will be automatic fitted,
this is usefull when a other timerset or tween was interrupted.
interval
interval in seconds to update the value, 0=every frame
var
the name of the variable to change
startvalue
start value for var, let this parameter empty to get current value
destvalue
destination value for the variable
tweentype (optional)
interpolation type, default="linear"
have a look here for all available tween types: tweentypes
updatefu (optional)
"screen" to refresh, "view" to redraw, default=""
waitflag (optional)
wait until done (user control will be blocked in this time)
default=true
- this is a short form of the timerset action
- it changes the current value of an API variable to a destination value
- if a other timerset/tween is already modifying the same value it will be stoped
parameters:
var
the name of the variable to change
destvalue
destination value for the variable
time (optional)
time to run in seconds, default=0.5
it is possible to use here a special function that calculates the time depending on the
distance between the start and destination value:
distance(maxdistance,maxtime)
maxdistance - the maximum distance between start and destination values
maxtime - the time in seconds for this maximum distance
now depending on the current value/position the needed time will be automatic fitted,
this is usefull when a other timerset or tween was interrupted.
tweentype (optional)
interpolation type, default="easeoutquad"
have a look here for all available tween types: tweentypes
donecall (optional)
action to call when done
example - fade out a plugin by changing it's alpha value to 0
<plugin ...
onclick="tween(alpha, 0);"
/>
example - change the size of hotspot on onover and onout
possible blending modes:
- NOBLEND = no blending (=default)
- BLEND(n) = blends from current panorama to next in "n" seconds
- ZOOMBLEND(n,z) = zooms and blends in "n" seconds with zoom factor "z"
onstart (decrepated)
sets onstart actions for the next panorama
see - new in 1.0.5 notes
Notes - NOPREVIEW:
If you use the wait(load) action and NOPREVIEW the wait action waits
until the main panorama image is completly loaded, before continuing on next actions or on interacting in the pano.
But without NOPREVIEW the the wait(load) action only waits until the preview image is loaded!
- passes the content of a xml file as string for loading
parameters:
xmlstring
the xml as string, should be escape-coded
...other parameters... (optional)
the same like in the loadpano() action
reload / reloadpano()
- reloads the current panorama
if you change some parameters like "image.sphere.url" or "image.type"
the panorama must be reloaded to take effect.
see the API documentation for "load only" variables, these variables
will be only parsed on loading.
wait(arg)
- wait until something is finished (user control will be blocked in this time)
parameters:
arg
if arg is a number -> this the time it will wait in seconds
if arg is "load" -> wait until loading is finished
if arg is "blend" -> wait until loading and blending are finished
- freezes the current view and blocks user control
- this increases the performance of elements that will be drawn on top of the pano
parameters:
state
true - freezes the view
false - restores normal state
example:
...
stop / stopall()
- stops/breaks all current running actions/timersets/tweens
- removes the rest of the queued actions
breakall()
- stops/breaks all current running actions/timersets/tweens
- continues with the rest of the queued actions
oninterrupt(newaction)
- this function can be set before starting a lot of action calls
- it was called when a mouse click interrupts one of following actions
- after interrupting or processing all actions, this function will be disabled until next call
parameters:
newaction
actions to call on interrupt
there is a special case action - "break"
- this will break the current actions