Ver Mensaje Individual
  #5 (permalink)  
Antiguo 20/11/2008, 15:35
Avatar de Lynxcraft
Lynxcraft
 
Fecha de Ingreso: noviembre-2007
Ubicación: yecla murcia
Mensajes: 1.346
Antigüedad: 16 años, 5 meses
Puntos: 51
Respuesta: Pausar una precarga | as2

a ver no se como tienes distribuido tu swf pero supongo que las demás imágenes están en diferentes frames asi que puedes acer la precaga a medias seria algo asi

Código PHP:
stop();
var 
porcentaje:Number 0;
var 
arranca:Boolean true;
this.onEnterFrame = function ()
{
    if (
arranca
    {
     
        
this.total_frames this.getBytesTotal();
        
this.resto_frames this.getBytesLoaded();
        
porcentaje Math.floor(this.resto_frames this.total_frames 100);
        
// estos datos son los que nuestro en pantalla 


        
texto.text porcentaje "%";
        
barra._xscale=porcentaje

 
////////////////////////////////////////////
     
if (porcentaje >10 )     // anulo esto que ase que se carge entero if (this.resto_frames == this.total_frames) 
        
        
        
{
           
delete (this.onEnterFrame);
            
            
arranca false;
            
gotoAndStop(2)
            
        }
    }
}

bueno en esta parte if (porcentaje >10 ) de digo al script que si supera del 10% pase al frame 2 y si quieres que prosiga con la precarga en el boton pones el mismo codigo pero modificado de esta manera

Código PHP:
on(Press){
var 
porcentaje:Number 0;
var 
arranca:Boolean true;

this.onEnterFrame = function ()
{
    if (
arranca
    {
     
        
this.total_frames this.getBytesTotal();
        
this.resto_frames this.getBytesLoaded();
        
porcentaje Math.floor(this.resto_frames this.total_frames 100);
        
// estos datos son los que nuestro en pantalla 


        
texto.text porcentaje "%";
        
barra._xscale=porcentaje

  
if (this.resto_frames == this.total_frames
        
        
        {
           
delete (this.onEnterFrame);
            
            
arranca false;
          
play()
            
        }
    }
}
}

aunque seria inútil porque en cuanto el usuario abre la pagina esta se carga quieras o no XDXDXD pero aver si te sirve
__________________
Sobran las ideas cuando faltan ganas de trabajar en ellas
Lynxcraft