I'm trying to time video "Transitions" and am running into intermittent issues.
http://vtour.govtour.com/vtour_preview.php?tid=3707#
If you go to the link above and click any of the hotspots with triangles you can observe what I'm trying to do.
When clicking on a "Transition" hotspot and going to a new scene the following should occur:
Trace - Total Time ( Total time of the Transition ).
Trace - Time to fire ( 3 seconds less than Total time ).
Trace - "Load Scene NOW" ( this should fire 3 seconds prior to the end of the transition ).
However, sometimes the Trace - "Load Scene NOW", fires immediately with the first two Trace events. Meaning the scene is loaded immediately and not 3 seconds prior to the end of the transition - The loop ends prematurely.
I can't tell if a variable is somehow holding onto a value or what.
Anyone care to take a gander?
I call the action cascade with…….
gotrans($media,$actscene,$dest_h,$dest_v);
Here are the relevant code blocks:
<plugin name="trans"
url="%SWFPATH%/player/plugins/videoplayer.swf"
visible="false" enabled="true"
keep="true"
zorder="0"
align="lefttop" x="0" y="0"
width="100%"
height="100%"
alpha="0.0"
refreshrate="auto"
buffertime="0.1"
iscomplete="false"
isvideoready="true"
loop="false"
onvideoready=""
onvideocomplete="tween(plugin[trans].alpha,0.0,2,default,set(plugin[trans].visible,false)); closevideo();"
pausedonstart="false"
updateeveryframe="true"
volume="1"
/>
<action name="gettranstime">
showlog(true);
set(mytime, 0);
set(mytime,get(plugin[trans].totaltime));
trace('Total time=',get(mytime));
sub(mytime, 3);
trace('Time to fire=',get(mytime));
set(transtime, 0);
set(transtime,get(plugin[trans].time));
loop(mytime GE transtime,
set(transtime,get(plugin[trans].time));
wait(0);
);
trace('Load Scene NOW');
loadscene(%1,view.hlookat=%2&view.vlookat=%3,MERGE,BLEND(2));
js(setPrevScene(%1));
set(mytime, 0);
set(transtime, 0);
</action>
<action name="gotrans">
set(plugin[trans].onvideoready,gettranstime(%2,%3,%4));
set(hotspot.enabled,false);
plugin[trans].playvideo(%SWFPATH%/player/media/%1.mp4);
set(plugin[trans].visible,true);
tween(plugin[trans].alpha,1);
</action>