Sie sind nicht angemeldet.

1

Montag, 13. Juni 2011, 09:46

Slider-Blend-Cube Loading Bar Help!

Hello!

I have two cuestions:
¿which is the correct code to display the loading progress bar in this example:?

www.otero27.com/daynight

¿and how I can do to make the panos load first before you can move it?

The code is from the example Slider-Blend-Cube:



loadscene(get(scene[0].name), null, MERGE);

</action>
url="hotspots/arrow.png"
altonloaded="if(isphone, mul(scale,2)); onloaded();"
/>

ondown="startdragingslider();"
onup="stopdragingslider();"/>

set(plugin[slider_grip].backup_align, get(plugin[slider_grip].align));
set(plugin[slider_grip].backup_edge, get(plugin[slider_grip].edge));

plugin[slider_grip].changeorigin(lefttop,lefttop);

sub(mouse_x_offset, plugin[slider_grip].x, mouse.x);
sub(mouse_y_offset, plugin[slider_grip].y, mouse.y);

set(image_dragging,true);

dragslider();
</action>

set(image_dragging, false);
</action>

if(image_dragging,
add(xpos, mouse.x, mouse_x_offset);
sub(xmax, plugin[slider_bg].width, plugin[slider_grip].width);
if(xpos LT 0, set(xpos,0));
if(xpos GT xmax, copy(xpos,xmax));
copy(plugin[slider_grip].x, xpos);

div(val, xpos, xmax);
setblend(get(val));

delayedcall(0.01, dragslider() );
,
plugin[slider_grip].changeorigin(get(plugin[slider_grip].backup_align), get(plugin[slider_grip].backup_edge));
);
</action>

addhotspot(%1);
set(hotspot[%1].url, %2);
set(hotspot[%1].ath, %3);
set(hotspot[%1].atv, %4);
set(hotspot[%1].width, 1000);
set(hotspot[%1].height, 1000);
set(hotspot[%1].distorted, true);
set(hotspot[%1].enabled, false);
set(hotspot[%1].visible, false);
set(hotspot[%1].alpha, 0.0);
set(hotspot[%1].details, 16);
set(hotspot[%1].zorder, %1);
</action>

addface(face_%1_F, 'daynight/%1_f.jpg', 0, 0);
addface(face_%1_L, 'daynight/%1_l.jpg', -90, 0);
addface(face_%1_R, 'daynight/%1_r.jpg', +90, 0);
addface(face_%1_B, 'daynight/%1_b.jpg', +180, 0);
addface(face_%1_Z, 'daynight/%1_u.jpg', 0, -90);
addface(face_%1_N, 'daynight/%1_d.jpg', 0, +90);
</action>

set(%1.alpha, %2);
if(%1.alpha == 0.0, set(%1.visible,false), set(%1.visible,true));
</action>

setalpha(hotspot[face_%1_F], %2);
setalpha(hotspot[face_%1_L], %2);
setalpha(hotspot[face_%1_R], %2);
setalpha(hotspot[face_%1_B], %2);
setalpha(hotspot[face_%1_Z], %2);
setalpha(hotspot[face_%1_N], %2);
</action>

addcube(pano1);
addcube(pano2);

setblend(0);
</action>

sub(blend2, 1.0, %1);
setcubealpha(pano1, %1);
setcubealpha(pano2, get(blend2));
</action>


I hope someone can help me!

Greetings from Mexico.
;-)




2

Mittwoch, 15. Juni 2011, 14:11

Hi,

this is a special case - the images were loaded as hotspots and the progress bar will shown only for real pano images,

showing a loading bar or text would be possible, but a bit tricky - the "onloaded" event of each hotspot could be used to increase a user defined loading counter variable, and then this counter could be used to scale and/or mask a loading bar or to calculate a text and show that...

best regards,
Klaus