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

filtros

Estas en el tema de filtros en el foro de Flash y Actionscript en Foros del Web. Estoy haciendo un albun de fotos y use este escript. ¿que deberia modificar si en ves e el efecto de blur quisiera un fade in, ...
  #1 (permalink)  
Antiguo 12/04/2008, 12:29
 
Fecha de Ingreso: enero-2005
Mensajes: 31
Antigüedad: 19 años, 3 meses
Puntos: 0
filtros

Estoy haciendo un albun de fotos y use este escript. ¿que deberia modificar si en ves e el efecto de blur quisiera un fade in, habra posibilidades de agregar un fade out?


Cita:


//Importo el filtro BlurFilter
import flash.filters.BlurFilter;
//Asigno desenfoque
var bf:BlurFilter = new BlurFilter(14, 14, 3);

function cargarXML(cargado) {
if (cargado) {
xmlNodo = this.firstChild;
imagen = [];
titulo = [];
total = xmlNodo.childNodes.length;
for (i=0; i<total; i++) {
imagen[i] = xmlNodo.childNodes[i].childNodes[0].firstChild.nodeValue;
titulo[i] = xmlNodo.childNodes[i].childNodes[1].firstChild.nodeValue;
}
CargarPrimeraImagen();
} else {
trace("algo ha fallado");
}
}
xmlAlbum = new XML();
xmlAlbum.ignoreWhite = true;
xmlAlbum.onLoad = cargarXML;
xmlAlbum.load(Cargar);



////PRECARGA///////
//Cada vez que entra en el frame
this.onEnterFrame = function() {
//peso es igual al peso total de "contenedor_mc"
peso =contenedor_mc.getBytesTotal()
//cargado es igual a lo que se ha cargado hasta ese momento de "contenedor_mc"
cargado = contenedor_mc.getBytesLoaded()
//Si cargado es distinto de
if (cargado != peso ) {
//escribo el valor de lo cargado en la caja de texto
precarga_txt.text = Math.round(cargado*100/peso)

/////////+" % cargado";

//Si eso no ocurre...
} else {
//y si el alfa del contenedor es menor de 100
if (bf.blurX > 0) {
//voy enfocando la foto
bf.blurX--;
bf.blurY--;
contenedor_mc.filters = [bf];
}
}
};



////PRIMERA IMAGEN///////
//generamos la funcion
function CargarPrimeraImagen() {
//cargamos en el clip de película "contenedor_mc"
//con el primer valor del array imagen
posarray=0
contenedor_mc.loadMovie(imagen[posarray],1);
bf.blurX = 14;
bf.blurY = 14;
//Mostramos la barra de titulo
this.Texto_mc.gotoAndPlay(2)
//Cargamos el titulo
_root.Texto_mc.Titulo_txt.text = titulo[posarray];
Estado = "Activo";
Carrusel()
}
///SIGUIENTE IMAGEN////////
function SiguienteImagen() {
//Si al menos queda una imagen para llegar al total
if (posarray<(total-1)) {
//Sumo 1 a posarray
posarray++;
//Cargamos la imagen
contenedor_mc.loadMovie(imagen[posarray]);
bf.blurX = 14;
bf.blurY = 14;
//Mostramos la barra de titulo
this.Texto_mc.gotoAndPlay(2)
//Cargamos el titulo
_root.Texto_mc.Titulo_txt.text = titulo[posarray];
Carrusel()
}
}
////CARRUSEL//////
retraso=4000
function Carrusel() {
miIntervalo = setInterval(pararcarrusel, retraso);
function pararcarrusel() {
clearInterval(miIntervalo);
if (posarray == (total-1)) {
posarray = -1;
CargarPrimeraImagen();
} else {
SiguienteImagen();
}
}
}
////PARAR EL SLIDESHOW//////
this.Stop_btn.onRelease = function() {
//Limpiamos el intervalo
//para parar el slideshow
clearInterval(miIntervalo);
Estado = "Parado";
}
////REINICIAR EL SLIDESHOW//////
this.Play_btn.onRelease = function() {
Carrusel();
Estado = "Activo";
}
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 11:45.