Foros del Web » Creando para Internet » Flash y Actionscript »

Ayuda codigo AS 2.0!

Estas en el tema de Ayuda codigo AS 2.0! en el foro de Flash y Actionscript en Foros del Web. Bueno este codigo me sirve para cargar la imagen desde carpetas separaadas del flash, pero yo quiero cargarlos desde la biblioteca, cual seria el cambio ...
  #1 (permalink)  
Antiguo 25/03/2010, 16:22
 
Fecha de Ingreso: marzo-2010
Mensajes: 9
Antigüedad: 14 años, 1 mes
Puntos: 0
Ayuda codigo AS 2.0!

Bueno este codigo me sirve para cargar la imagen desde carpetas separaadas del flash, pero yo quiero cargarlos desde la biblioteca, cual seria el cambio que deboo hacer?




this.pathToPics="imagenes/";
this.pArray=["img1.png","img2.png","img3.png","img4.png"];
this.fadeSpeed=5;
this.pIndex=0;
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
muestras="Foto Nº"+(this.pIndex+1)+" " +this.pArray[0];
MovieClip.prototype.chagePhoto=function(d){
this.pIndex=(this.pIndex+d)%this.pArray.length;
if(this.pIndex<0){
this.pIndex+=this.pArray.length;}
this.onEnterFrmae=fadeOut;
};

Movieclip.prototype.fadeOut=function(){
if(this.photo._alpha>this.fadeSpeed){
this.photo._alpha-=this.fadeSpeed;
}else{
this.loadPhoto();
}
};

MovieClip.prototype.loadPhoto=function(){
var p=root.photo;
p._alpha=0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
muestras="Foto Nº"+(this.pIndex+1)+" "+this.pArray[this.pIndex];
this.onEnterFrame=loadMeter;
};
MovieClip.prototype.loadMeter=function(){
var i,l,t;
l=this.photo.getBytesLoaded();
t=this.photo.getBytesTotal();
if(t>0 && t==1){
this.onEnterFrame=fadeln;
}else{
trace(l/t);
}
};
MovieClip.prototype.fadeln=function(){
if(this.photo._alpha<100-this.fadeSpeed){
this.photo._alpha+=this.fadeSpeed;
}else{
this.photo._alpha=100;
this.onEnterFrame=null;
}
};

//Retroceder
on(release, keyPress "<Left>"){
this.changePhoto(-1);
}

//Avanzar
on(release, keyPress "<Rigth>"){
this.changePhoto(1);
}
  #2 (permalink)  
Antiguo 25/03/2010, 16:26
Avatar de TMeister
Crazy Coder
 
Fecha de Ingreso: enero-2002
Ubicación: En la Oficina
Mensajes: 2.880
Antigüedad: 22 años, 3 meses
Puntos: 193
Respuesta: Ayuda codigo AS 2.0!

En lugar de loadmovie debes usar attachmovie:

http://livedocs.adobe.com/flash/9.0_...=00001891.html

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:59.