I've combined onpreviewcomplete and onloadcomplete in order to have a little planet loading intro but without causing a nasty time lag for anyone on a slow internet connection... but I am not sure if this approach is the best way or whether this is thread safe?
<view stereographic="true"
fisheye="1.0"
fov="150"
fovmax="150"
hlookat="160"
vlookat="90"
/>
<display flash10="off" details="14" />
<events onxmlcomplete="init();" onpreviewcomplete="delayedcall(4.0,anim());" onloadcomplete="anim();" />
<action name="init">
set(istat, 0);
</action>
<action name="anim">
if(istat LT 1,
set(istat, 1.0);
normalview();
);
</action>
<action name="normalview">
tween(view.hlookat, 30, 1.5, easeInOutQuad );
tween(view.vlookat, 0, 1.5, easeInOutQuad );
tween(view.fov, 90, 1.5, easeInOutQuad );
tween(view.maxpixelzoom, 1.0, 1.5, easeInOutQuad );
tween(view.fisheye, 0.0, 1.5, easeInOutQuad, WAIT);
set(display.flash10,on);
set(autorotate.speed,8.0);
set(autorotate.waittime,2.0);
set(autorotate.enabled,true);
</action>
Display More
The idea here is that the intro animation happens 4 seconds after preview loading at the latest. Someone on a fast Internet connection that loads the images within 4 seconds gets the intro animation straight away. I am using multi-resolution panoramas.
Incidentally when I say "thread safe" what I mean is that the anim action checks the value of istat before deciding whether to change it and kick of the normalview() animation... unless access to istat is synchronized (or unless only one action can execute at any one time) there is potential for a problem here I think???
You can see this in action on http://www.jamesrigg.com/ . I'd really appreciate any comments about whether there is a better way to do this or other ways to optimise loading to provide the best experience for both slow and fast Internet connections while using very high resolution multi-resolution panoramas.
Thanks
James.