it works only for the first scene, because in the "onloadcomplete" was set to 'null' after the first call,... but it only works for the first scene. I think this is because onloadcomplete works only once. Is there any other way to do this?
|
|
Quellcode |
1 |
set(event.onloadcomplete,null); |
|
|
Quellcode |
1 |
<events name="sceneevents" onloadcomplete="..." />
|
|
|
Quellcode |
1 |
<events onloadcomplete="preloadpano2(); preloadauto1(); preloadauto2(); preloadauto3()"/> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
<action name="preloadimage">
<!-- 1. parameter = internal ID, 2. parameter = url -->
addplugin(pre_%1);
set(plugin[pre_%1].visible, false);
set(plugin[pre_%1].onloaded, trace(preload %2 done);removeplugin(pre_%1) );
set(plugin[pre_%1].url, %2);
trace(starting preloading %2);
</action>
<action name="preloadpano1">
preloadimage(showroom_1_l, %SWFPATH%/tour.data/images/showroom_1_l.jpg);
preloadimage(showroom_1_f, %SWFPATH%/tour.data/images/showroom_1_f.jpg);
preloadimage(showroom_1_r, %SWFPATH%/tour.data/images/showroom_1_r.jpg);
preloadimage(showroom_1_b, %SWFPATH%/tour.data/images/showroom_1_b.jpg);
preloadimage(showroom_1_u, %SWFPATH%/tour.data/images/showroom_1_u.jpg);
preloadimage(showroom_1_d, %SWFPATH%/tour.data/images/showroom_1_d.jpg);
</action>
<action name="preloadauto1" keep="true">
preloadimage(auto_1_f, %SWFPATH%/tour.data/images/12_f.jpg);
preloadimage(auto_1_r, %SWFPATH%/tour.data/images/12_r.jpg);
preloadimage(auto_1_l, %SWFPATH%/tour.data/images/12_l.jpg);
preloadimage(auto_1_b, %SWFPATH%/tour.data/images/12_b.jpg);
preloadimage(auto_1_u, %SWFPATH%/tour.data/images/12_u.jpg);
preloadimage(auto_1_d, %SWFPATH%/tour.data/images/12_d.jpg);
</action>
<action name="preloadauto2" keep="true">
preloadimage(auto_2_f, %SWFPATH%/tour.data/images/13_f.jpg);
preloadimage(auto_2_r, %SWFPATH%/tour.data/images/13_r.jpg);
preloadimage(auto_2_l, %SWFPATH%/tour.data/images/13_l.jpg);
preloadimage(auto_2_b, %SWFPATH%/tour.data/images/13_b.jpg);
preloadimage(auto_2_u, %SWFPATH%/tour.data/images/13_u.jpg);
preloadimage(auto_2_d, %SWFPATH%/tour.data/images/13_d.jpg);
</action>
|
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
<scene name="showroom_1" title="showroom_1" onstart="" > <view vlookat="0" fovtype="MFOV" fov="100" fovmin="85" fovmax="120" /> <events onloadcomplete="preloadpano2(); preloadauto1(); preloadauto2(); preloadauto3()"/> <preview url="tour.data/images/showroom_1_preview.jpg" /> <image> <left url="tour.data/images/showroom_1_l.jpg" /> <front url="tour.data/images/showroom_1_f.jpg" /> <right url="tour.data/images/showroom_1_r.jpg" /> <back url="tour.data/images/showroom_1_b.jpg" /> <up url="tour.data/images/showroom_1_u.jpg" /> <down url="tour.data/images/showroom_1_d.jpg" /> </image> <hotspot name="spot_auto_1" style="hotspot_ani" url="tour.data/graphics/stuur_ani.png" ath="-115" atv="-3" scale="1" onhover="showtext('Opel Corsa 3 Drs ',hotspottextstyle)" onclick="transition(spot_auto_1, -115.0, 0.0, 0, auto_1, -20, 0, 110)" /> <hotspot name="spot_auto_2" style="hotspot_ani" url="tour.data/graphics/stuur_ani.png" ath="-95" atv="-3" scale="1" onhover="showtext('Opel Corsa 5 Drs ',hotspottextstyle)" onclick="transition(spot_auto_2, -95.0, 0.0, 0, auto_2, 0, 0, 100)" /> <hotspot name="spot_auto_3" style="hotspot_ani" url="tour.data/graphics/stuur_ani.png" ath="-65" atv="-3" scale="1" onhover="showtext('Opel Astra GTC ',hotspottextstyle)" onclick="transition(spot_auto_3, -65.0, 0.0, 0, auto_3, 0, 0, 100)" /> <hotspot name="spot_auto_4" style="hotspot_ani" url="tour.data/graphics/stuur_ani.png" ath="10" atv="-4" scale="1" onhover="showtext('Opel Astra Sports Tourer ',hotspottextstyle)" onclick="transition(spot_auto_4, 10, 0.0, 0, auto_4, 0, 0, 100)" /> <hotspot name="spot_auto_5" style="hotspot_ani" url="tour.data/graphics/stuur_ani.png" ath="102" atv="-4" scale="1" onhover="showtext('Opel Zafira Tourer ',hotspottextstyle)" onclick="transition(spot_auto_5, 102, 0.0, 0, auto_5, 0, 0, 100)" /> <hotspot name="spot_auto_7" style="hotspot_ani" url="tour.data/graphics/stuur_ani.png" ath="172" atv="-4" scale="1" onhover="showtext('Opel Astra 5 Drs ',hotspottextstyle)" onclick="transition(spot_auto_7, 172.0, 0.0, 0, auto_7, 20, 0, 100)" /> <hotspot name="spot_showroom_2" style="hotspot_ani" url="tour.data/graphics/hotspot_i.png" ath="185" atv="-4" scale="1" onclick="transition(spot_showroom_2, 185, 0, 0, showroom_2, 45, 0, 90)" onhover="showtext('showroom 2',hotspottextstyle)"/> </scene> |
|
|
Quellcode |
1 2 3 4 5 6 7 8 9 |
<action name="preloadimage">
<!-- 1. parameter = internal ID, 2. parameter = url -->
addplugin(pre_%1);
set(plugin[pre_%1].visible, false);
set(plugin[pre_%1].keep, true);
set(plugin[pre_%1].onloaded, trace(preload %2 done);removeplugin(pre_%1) );
set(plugin[pre_%1].url, %2);
trace(starting preloading %2);
</action>
|