Comunidad de diseño web y desarrollo en internet online

por qué no llega a ejecutarse ningún evento del escuchador?

Citar            
MensajeEscrito el 22 Nov 2007 06:32 pm
Hola, ¿por qué no llega a ejecutarse ningún evento del escuchador de este código?
(barraPorcentaje_mc es un clip de una barra que se hace mas grande en cada estado)

Código :

import flash.display.*;
import flash.geom.*;

var mc_pan:MovieClip = mc_pan.createEmptyMovieClip("miPan", this.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
var escuchar:Object = new Object();

escuchar.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number)
{
   var persoTotal = bytesTotal;
   var cargados = bytesLoaded;
   var porcentaje = Math.round(cargados*100/persoTotal);
   barraPorcentaje_mc.gotoAndStop(porcentaje);
   barraPorcentaje_mc.cargado_txt.text = porcentaje+"%";
};

escuchar.onLoadInit = function(target:MovieClip)
{
};

escuchar.onLoadStart = function(target:MovieClip) 
{
   barraPorcentaje_mc._visible = true;
};

escuchar.onLoadComplete = function(target:MovieClip, httpStatus:Number) 
{
      barraPorcentaje_mc._visible = false;
      gotoAndPlay(2);
};
//
this.mcLoader.addListener(escuchar);
this.mcLoader.loadClip("pan.jpg", mc_pan.miPan);
stop();

Por itnasag

10 de clabLevel



Genero:Masculino  

firefox
Citar            
MensajeEscrito el 23 Nov 2007 04:25 pm
usa diferente nombre para la variable que contendra la instancia del movieclip creado:

var NuevoMC:MovieClip = mc_pan.createEmptyMovieClip("miPan", this.getNextHighestDepth());

para que no se confunda con el movieclip llamado "mc_pan", así cuando cargues la imagen
haras referencia al movieclip mc_pan que contienen otro movieclip miPan, y no a la variable.

Por gabynufe

Claber

446 de clabLevel



 

México, D.F.

msie7

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.