Fading efecto con seis imágenes
- plumbum01
- Newbie


- Registrado: Ago 11, 2004
- Mensajes: 12
- Status: Offline
Hola a todos! Soy nuevo en este foro, e incluso en actionscripting, pero tengo un problema y espero que ustedes me ayuda.
Tengo que hacer esta animación, pero tengo problema con fade y en fade out.
http://www.verus.lt/images/main.swf
Como se puede ver:
1. primera imagen en la primera columna se desvanece a cabo
2. segunda imagen se desvanece, y espera hasta la segunda imagen en la tercera columna se desvanece en
3. primera imagen en la segunda columna se desvanece a cabo........ TEC
Creo que debe utilizar y las funciones setInterval, pero no pasa nada...
Por tanto, creo que, usted comprenderá todo, lo que quería decir...
Tengo que hacer esta animación, pero tengo problema con fade y en fade out.
http://www.verus.lt/images/main.swf
Como se puede ver:
1. primera imagen en la primera columna se desvanece a cabo
2. segunda imagen se desvanece, y espera hasta la segunda imagen en la tercera columna se desvanece en
3. primera imagen en la segunda columna se desvanece a cabo........ TEC
Creo que debe utilizar y las funciones setInterval, pero no pasa nada...
Por tanto, creo que, usted comprenderá todo, lo que quería decir...
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Agosto 11th, 2004, 2:57 am
- digitalMedia
- a.k.a. dM


- Registrado: Dic 29, 2003
- Mensajes: 5169
- Loc: SC-USA
- Status: Offline
Usted no tiene que utilizar las funciones, para / bucles próximo, si las declaraciones, _alpha propiedades o setInterval, pero seguro que ayuda.

No entiendo lo que su pregunta es. Esta es una cosa muy sencilla de realizar. Dónde estás atrapado? Por favor, ser más específico.
No entiendo lo que su pregunta es. Esta es una cosa muy sencilla de realizar. Dónde estás atrapado? Por favor, ser más específico.
- dM
- joebert
- Sledgehammer


- Registrado: Feb 10, 2004
- Mensajes: 13455
- Loc: Florida
- Status: Offline
Heres una manera de lograrlo,
Crossfade
Siéntase libre para señalar algo que no entiendo
FLA Fuente (MX no 2004) con imágenes en la biblioteca
/ / Edit
el enlace se había equivocado.
La tasa de fotogramas se establece en 20 cuadros por segundo, el primer cuadro contiene las medidas antes mencionadas se juega para inicializar todo es, pues, nunca volvió a ver, a partir del fotograma 2 cada 30 fotogramas hay una,
que desencadena la A y MCs b dentro de ese contenedor cajas a desaparecer con el nivel oppisite que se encuentra ahora.
en el fotograma 91 que hay,
El cambio de primera línea () s primero los ajustes objeto fuera de la matriz de valores y cambio de puesto () Ing. una matriz devuelve el elemento que se elimina, se push () lo que se devuelve al final de la matriz (de ahí el yin-yang )
La segunda línea es bastante autoexplicativo gif "alt =": wink: "title =" Wink "/> causas de la película para regresar de vuelta a la trama 2 y empezar de nuevo, esta vez los valores de la matriz de valores se invierten (Hay un método reverse () para las matrices, de esta manera es bueno saber si
. oO (ok así que me olvidé del método inverso gif "alt =": P "title =" Razz "/> )) Soooo, ahora con la configuración de revertir el a & b MCs dentro de la caja #contenedores se desvanecen en las direcciones oppisite esta vez (y cada iteración en adelante)
Crossfade
Siéntase libre para señalar algo que no entiendo
FLA Fuente (MX no 2004) con imágenes en la biblioteca
/ / Edit
Código: [ Select ]
//Prototype for individual fade
MovieClip.prototype.fadeTo = function(value,speed){ //alpha value to fade to, speed to fade it
this.onEnterFrame = function() {
this.aV = Math.floor(value-this._alpha);
this.aV ? this._alpha += this.aV/speed : (this._alpha=value, delete this.onEnterFrame);
}
}
//Prototype to apply fade prototype to both mC's inside the mC
MovieClip.prototype.crossFade = function(a_,b_){ //takes two objects with v,s as attributes for each
this.a.fadeTo(a_.v, a_.s);
this.b.fadeTo(b_.v, b_.s);
}
/*Create some containers & attach the properly linked image mC's to them from the library*/
for(i=1; i<4; i++){
createEmptyMovieClip("box"+i,i);
this["box"+i].attachMovie(("p"+i),"a",0);
this["box"+i].attachMovie(("p"+(i+3)),"b",1);
}
/*Place them at the proper cords on the stage, & declare box#.b._alpha=0 cause it's easier to do it here :P (ok this could be added to for loop but I don't feel like editing it right now :P )*/
box1._x=10; box1._y=10; box1.b._alpha=0;
box2._x=210; box2._y=10; box2.b._alpha=0;
box3._x=410; box3._y=10;box3.b._alpha=0;
/*create a "yin-yang" array with two objects for fade params, this array will have the first element shifted to the end of the array in the last frame to achieve alternating fades*/
settings = [{v:0, s:10}, {v:100, s: 20}];
MovieClip.prototype.fadeTo = function(value,speed){ //alpha value to fade to, speed to fade it
this.onEnterFrame = function() {
this.aV = Math.floor(value-this._alpha);
this.aV ? this._alpha += this.aV/speed : (this._alpha=value, delete this.onEnterFrame);
}
}
//Prototype to apply fade prototype to both mC's inside the mC
MovieClip.prototype.crossFade = function(a_,b_){ //takes two objects with v,s as attributes for each
this.a.fadeTo(a_.v, a_.s);
this.b.fadeTo(b_.v, b_.s);
}
/*Create some containers & attach the properly linked image mC's to them from the library*/
for(i=1; i<4; i++){
createEmptyMovieClip("box"+i,i);
this["box"+i].attachMovie(("p"+i),"a",0);
this["box"+i].attachMovie(("p"+(i+3)),"b",1);
}
/*Place them at the proper cords on the stage, & declare box#.b._alpha=0 cause it's easier to do it here :P (ok this could be added to for loop but I don't feel like editing it right now :P )*/
box1._x=10; box1._y=10; box1.b._alpha=0;
box2._x=210; box2._y=10; box2.b._alpha=0;
box3._x=410; box3._y=10;box3.b._alpha=0;
/*create a "yin-yang" array with two objects for fade params, this array will have the first element shifted to the end of the array in the last frame to achieve alternating fades*/
settings = [{v:0, s:10}, {v:100, s: 20}];
- //Prototype for individual fade
- MovieClip.prototype.fadeTo = function(value,speed){ //alpha value to fade to, speed to fade it
- this.onEnterFrame = function() {
- this.aV = Math.floor(value-this._alpha);
- this.aV ? this._alpha += this.aV/speed : (this._alpha=value, delete this.onEnterFrame);
- }
- }
- //Prototype to apply fade prototype to both mC's inside the mC
- MovieClip.prototype.crossFade = function(a_,b_){ //takes two objects with v,s as attributes for each
- this.a.fadeTo(a_.v, a_.s);
- this.b.fadeTo(b_.v, b_.s);
- }
- /*Create some containers & attach the properly linked image mC's to them from the library*/
- for(i=1; i<4; i++){
- createEmptyMovieClip("box"+i,i);
- this["box"+i].attachMovie(("p"+i),"a",0);
- this["box"+i].attachMovie(("p"+(i+3)),"b",1);
- }
- /*Place them at the proper cords on the stage, & declare box#.b._alpha=0 cause it's easier to do it here :P (ok this could be added to for loop but I don't feel like editing it right now :P )*/
- box1._x=10; box1._y=10; box1.b._alpha=0;
- box2._x=210; box2._y=10; box2.b._alpha=0;
- box3._x=410; box3._y=10;box3.b._alpha=0;
- /*create a "yin-yang" array with two objects for fade params, this array will have the first element shifted to the end of the array in the last frame to achieve alternating fades*/
- settings = [{v:0, s:10}, {v:100, s: 20}];
La tasa de fotogramas se establece en 20 cuadros por segundo, el primer cuadro contiene las medidas antes mencionadas se juega para inicializar todo es, pues, nunca volvió a ver, a partir del fotograma 2 cada 30 fotogramas hay una,
Código: [ Select ]
box#.crossFade(settings[0], settings[1]);
que desencadena la A y MCs b dentro de ese contenedor cajas a desaparecer con el nivel oppisite que se encuentra ahora.
en el fotograma 91 que hay,
Código: [ Select ]
settings.push(settings.shift());
gotoAndPlay(2);
gotoAndPlay(2);
- settings.push(settings.shift());
- gotoAndPlay(2);
El cambio de primera línea () s primero los ajustes objeto fuera de la matriz de valores y cambio de puesto () Ing. una matriz devuelve el elemento que se elimina, se push () lo que se devuelve al final de la matriz (de ahí el yin-yang )
La segunda línea es bastante autoexplicativo gif "alt =": wink: "title =" Wink "/> causas de la película para regresar de vuelta a la trama 2 y empezar de nuevo, esta vez los valores de la matriz de valores se invierten (Hay un método reverse () para las matrices, de esta manera es bueno saber si
Strong with this one, the sudo is.
- plumbum01
- Newbie


- Registrado: Ago 11, 2004
- Mensajes: 12
- Status: Offline
- joebert
- Sledgehammer


- Registrado: Feb 10, 2004
- Mensajes: 13455
- Loc: Florida
- Status: Offline
- plumbum01
- Newbie


- Registrado: Ago 11, 2004
- Mensajes: 12
- Status: Offline
- joebert
- Sledgehammer


- Registrado: Feb 10, 2004
- Mensajes: 13455
- Loc: Florida
- Status: Offline
importación como en loadMovie () derecho de importación?
Dentro de este lugar un nuevo MC, cambiar la attachMovie () con loadMovie () y jugar una vez todas las imágenes están cargados.
Id dar un ejemplo pero no puedo ver cómo, sin importar las imágenes.
editar / / a continuación, una vez más, lo que de frames está usando, podría tener que ajustar algunos números, como así
Dentro de este lugar un nuevo MC, cambiar la attachMovie () con loadMovie () y jugar una vez todas las imágenes están cargados.
Id dar un ejemplo pero no puedo ver cómo, sin importar las imágenes.
editar / / a continuación, una vez más, lo que de frames está usando, podría tener que ajustar algunos números, como así
Strong with this one, the sudo is.
- plumbum01
- Newbie


- Registrado: Ago 11, 2004
- Mensajes: 12
- Status: Offline
Sí, yo uso loadMovie (). ¡Gracias por ayudarme a joebert 
AC en el primer fotograma:
AC en el primer fotograma:
Código: [ Select ]
//loading 1_1 picture
foto1_1.onLoad = function() {
var maxWidth = 100;
var maxHeight = 100;
if (this._width>maxWidth || this._height>maxHeight)
{
var scaleFactor = this._width>this._height ? maxWidth/this._width : maxHeight/this._height;
this._width = Math.floor(this._width*scaleFactor);
this._height = Math.floor(this._height*scaleFactor);
}
}
foto1_1.onData = function() {
}
foto1_1.loadMovie("flash/1_1.jpg");
And this one in the movieClip named foto1_1:
onClipEvent(data) {
this._width = 162;
this._height = 113;
}
foto1_1.onLoad = function() {
var maxWidth = 100;
var maxHeight = 100;
if (this._width>maxWidth || this._height>maxHeight)
{
var scaleFactor = this._width>this._height ? maxWidth/this._width : maxHeight/this._height;
this._width = Math.floor(this._width*scaleFactor);
this._height = Math.floor(this._height*scaleFactor);
}
}
foto1_1.onData = function() {
}
foto1_1.loadMovie("flash/1_1.jpg");
And this one in the movieClip named foto1_1:
onClipEvent(data) {
this._width = 162;
this._height = 113;
}
- //loading 1_1 picture
- foto1_1.onLoad = function() {
- var maxWidth = 100;
- var maxHeight = 100;
- if (this._width>maxWidth || this._height>maxHeight)
- {
- var scaleFactor = this._width>this._height ? maxWidth/this._width : maxHeight/this._height;
- this._width = Math.floor(this._width*scaleFactor);
- this._height = Math.floor(this._height*scaleFactor);
- }
- }
- foto1_1.onData = function() {
- }
- foto1_1.loadMovie("flash/1_1.jpg");
- And this one in the movieClip named foto1_1:
- onClipEvent(data) {
- this._width = 162;
- this._height = 113;
- }
- joebert
- Sledgehammer


- Registrado: Feb 10, 2004
- Mensajes: 13455
- Loc: Florida
- Status: Offline
- plumbum01
- Newbie


- Registrado: Ago 11, 2004
- Mensajes: 12
- Status: Offline
- joebert
- Sledgehammer


- Registrado: Feb 10, 2004
- Mensajes: 13455
- Loc: Florida
- Status: Offline
Im Sorry tarde, Su sido un día difícil....
Heres una versión loadMovie
Heres el fuente (theres casi tan numerosos comentarios como código
)
Heres un vistazo a las cosas antes de la apertura de Flash gif "alt =";)" title =" Wink "/>
Este es el primer fotograma de la línea de tiempo principal, lo único nuevo aquí es la jpgLoadResize (que debe ser loadposition () pero tuve un brainfart al hacerlo)
Ahora, para hacer más fácil que crear un nuevo símbolo con nada en él, pero las acciones que se refieren a las cosas en su interior y uso de los prototipos de arriba. (por qué no poner los prototipos dentro de la stmbol lo preguntas? puesta en la raíz hace que sea más fácil encontrarlas a la referencia si tenemos somthing otra cosa que quiere usarlos)
Ahora, en el primer fotograma clave (debe ser el único que en este momento
) Tenemos estas acciones para establecer las cosas.
Ahora debemos insertar un nuevo fotograma clave en el fotograma 2 y darle este trozo de código,
Ahora, por cada caja que vamos a tener que insertar un nuevo fotograma clave 30 cuadros de la última (31,61) También tenemos que insertar un suplemento de 30 marcos de ese último por lo que no se inicia la decoloración hthe primer cuadro de la derecha después de la pasado, también será la inversión de la matriz de configuración de este último fotograma.
En cada uno de los fotogramas clave que hemos insertado en las casillas que añadimos las acciones antes mencionadas sólo cambiando el número se añade al final de la caja (box0, box1, box2, etc...)
En el último cuadro que tenemos la inversión de la matriz y gotoAndPlay (2) acciones,
BTW, este fla es <14KB y la película reúne a ser <1KB (890 bytes en mi máquina)
Heres una versión loadMovie
Heres el fuente (theres casi tan numerosos comentarios como código
Heres un vistazo a las cosas antes de la apertura de Flash gif "alt =";)" title =" Wink "/>
Este es el primer fotograma de la línea de tiempo principal, lo único nuevo aquí es la jpgLoadResize (que debe ser loadposition () pero tuve un brainfart al hacerlo)
Código: [ Select ]
//Prototype for individual fade
MovieClip.prototype.fadeTo = function(value,speed){//(alpha value to fade to, speed to fade it)
/* Do this FPS times per second */
this.onEnterFrame = function() {
this.aV = Math.floor(value-this._alpha);
/* if(this.aV == true){ this._alpha += ..... }else{this._alpha=value; & stop doing this */
this.aV ? this._alpha += this.aV/speed : (this._alpha=value, delete this.onEnterFrame);
}
}
//Prototype to apply fade prototype to both mC's inside the mC
MovieClip.prototype.crossFade = function(a_,b_){ //takes two objects with v,s as attributes for each
/* apply fade to containers a & b with the values of the setings array */
this.a.fadeTo(a_.v, a_.s);
this.b.fadeTo(b_.v, b_.s);
}
/*Prototype to load JPGs into containers a & b inside the movieclip(or box#) this is applied to. This prototype will apply itself to every box# in the main container untill half of the number of pics in picArray have been reached, then it will tell the container to play() */
MovieClip.prototype.jpgLoadResize = function(pic,pad){/*pic should always be entered as 0, the prototype will increment it on it's own. pad is the number of pixels to add between each movieclip( or box#) */
this.a.loadMovie(this._parent.picArray[pic]);
/*container b will load pic+(pics/2) jpg, in other words if there are 6 pics the first call will load 0 into a & 4 into b , second call, 1 into a 5 into b, ect.. when filling picArray put all of the images for a in it then add b's images */
this.b.loadMovie(this._parent.picArray[(pic+(this._parent.picArray.length/2))]);
this.onEnterFrame = function(){
/* since the movieclips/boxes are created dynamically they have a width of 0, if the width is larger than that then we know how wide the image is & can position it accordingly */
if(this.a._width > 1 && this.b._width > 1){
/*set the alpha of b so there is no "fishtank time" */
this.b._alpha=0;
/* if pic is greater than 0 then we know this is not the first loop so we get the _x & _width of the last container/box processed, add the pad value to that, & place this movieclip/box at that number. else it's the first loop & we place it at pads value */
pic > 0 ? (this._x = ((this._parent["box"+(pic-1)]._x + this._parent["box"+(pic-1)]._width)+pad)) : (this._x=pad);
/* if adding 1 to pic is less than the number of images/2 then we re-call this prototype on the next movieclip/box. else tell the main container to play() */
((pic+1) < (this._parent.picArray.length/2)) ? this._parent["box"+(pic+1)].jpgLoadResize(pic+1,pad) : this._parent.play();
/* well the pics are loaded, we have our container where we want it, & we have shown the next movieclip/box how to follow in our footsteps, time to retire :P */
delete this.onEnterFrame;
}
}
}
MovieClip.prototype.fadeTo = function(value,speed){//(alpha value to fade to, speed to fade it)
/* Do this FPS times per second */
this.onEnterFrame = function() {
this.aV = Math.floor(value-this._alpha);
/* if(this.aV == true){ this._alpha += ..... }else{this._alpha=value; & stop doing this */
this.aV ? this._alpha += this.aV/speed : (this._alpha=value, delete this.onEnterFrame);
}
}
//Prototype to apply fade prototype to both mC's inside the mC
MovieClip.prototype.crossFade = function(a_,b_){ //takes two objects with v,s as attributes for each
/* apply fade to containers a & b with the values of the setings array */
this.a.fadeTo(a_.v, a_.s);
this.b.fadeTo(b_.v, b_.s);
}
/*Prototype to load JPGs into containers a & b inside the movieclip(or box#) this is applied to. This prototype will apply itself to every box# in the main container untill half of the number of pics in picArray have been reached, then it will tell the container to play() */
MovieClip.prototype.jpgLoadResize = function(pic,pad){/*pic should always be entered as 0, the prototype will increment it on it's own. pad is the number of pixels to add between each movieclip( or box#) */
this.a.loadMovie(this._parent.picArray[pic]);
/*container b will load pic+(pics/2) jpg, in other words if there are 6 pics the first call will load 0 into a & 4 into b , second call, 1 into a 5 into b, ect.. when filling picArray put all of the images for a in it then add b's images */
this.b.loadMovie(this._parent.picArray[(pic+(this._parent.picArray.length/2))]);
this.onEnterFrame = function(){
/* since the movieclips/boxes are created dynamically they have a width of 0, if the width is larger than that then we know how wide the image is & can position it accordingly */
if(this.a._width > 1 && this.b._width > 1){
/*set the alpha of b so there is no "fishtank time" */
this.b._alpha=0;
/* if pic is greater than 0 then we know this is not the first loop so we get the _x & _width of the last container/box processed, add the pad value to that, & place this movieclip/box at that number. else it's the first loop & we place it at pads value */
pic > 0 ? (this._x = ((this._parent["box"+(pic-1)]._x + this._parent["box"+(pic-1)]._width)+pad)) : (this._x=pad);
/* if adding 1 to pic is less than the number of images/2 then we re-call this prototype on the next movieclip/box. else tell the main container to play() */
((pic+1) < (this._parent.picArray.length/2)) ? this._parent["box"+(pic+1)].jpgLoadResize(pic+1,pad) : this._parent.play();
/* well the pics are loaded, we have our container where we want it, & we have shown the next movieclip/box how to follow in our footsteps, time to retire :P */
delete this.onEnterFrame;
}
}
}
- //Prototype for individual fade
- MovieClip.prototype.fadeTo = function(value,speed){//(alpha value to fade to, speed to fade it)
- /* Do this FPS times per second */
- this.onEnterFrame = function() {
- this.aV = Math.floor(value-this._alpha);
- /* if(this.aV == true){ this._alpha += ..... }else{this._alpha=value; & stop doing this */
- this.aV ? this._alpha += this.aV/speed : (this._alpha=value, delete this.onEnterFrame);
- }
- }
- //Prototype to apply fade prototype to both mC's inside the mC
- MovieClip.prototype.crossFade = function(a_,b_){ //takes two objects with v,s as attributes for each
- /* apply fade to containers a & b with the values of the setings array */
- this.a.fadeTo(a_.v, a_.s);
- this.b.fadeTo(b_.v, b_.s);
- }
- /*Prototype to load JPGs into containers a & b inside the movieclip(or box#) this is applied to. This prototype will apply itself to every box# in the main container untill half of the number of pics in picArray have been reached, then it will tell the container to play() */
- MovieClip.prototype.jpgLoadResize = function(pic,pad){/*pic should always be entered as 0, the prototype will increment it on it's own. pad is the number of pixels to add between each movieclip( or box#) */
- this.a.loadMovie(this._parent.picArray[pic]);
- /*container b will load pic+(pics/2) jpg, in other words if there are 6 pics the first call will load 0 into a & 4 into b , second call, 1 into a 5 into b, ect.. when filling picArray put all of the images for a in it then add b's images */
- this.b.loadMovie(this._parent.picArray[(pic+(this._parent.picArray.length/2))]);
- this.onEnterFrame = function(){
- /* since the movieclips/boxes are created dynamically they have a width of 0, if the width is larger than that then we know how wide the image is & can position it accordingly */
- if(this.a._width > 1 && this.b._width > 1){
- /*set the alpha of b so there is no "fishtank time" */
- this.b._alpha=0;
- /* if pic is greater than 0 then we know this is not the first loop so we get the _x & _width of the last container/box processed, add the pad value to that, & place this movieclip/box at that number. else it's the first loop & we place it at pads value */
- pic > 0 ? (this._x = ((this._parent["box"+(pic-1)]._x + this._parent["box"+(pic-1)]._width)+pad)) : (this._x=pad);
- /* if adding 1 to pic is less than the number of images/2 then we re-call this prototype on the next movieclip/box. else tell the main container to play() */
- ((pic+1) < (this._parent.picArray.length/2)) ? this._parent["box"+(pic+1)].jpgLoadResize(pic+1,pad) : this._parent.play();
- /* well the pics are loaded, we have our container where we want it, & we have shown the next movieclip/box how to follow in our footsteps, time to retire :P */
- delete this.onEnterFrame;
- }
- }
- }
Ahora, para hacer más fácil que crear un nuevo símbolo con nada en él, pero las acciones que se refieren a las cosas en su interior y uso de los prototipos de arriba. (por qué no poner los prototipos dentro de la stmbol lo preguntas? puesta en la raíz hace que sea más fácil encontrarlas a la referencia si tenemos somthing otra cosa que quiere usarlos)
Ahora, en el primer fotograma clave (debe ser el único que en este momento
Código: [ Select ]
/*create a static array full of paths to JPGs, realistically this array would be filled with data from XML, but for examples sake this will do*/
picArray = ["pic1.jpg","pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg","pic6.jpg"];
/*create a "yin-yang" array with two objects for fade params, this array will get reversed ;) to alternate the fades. If you allready have a _global.settings declared from somthing else then make sure you replace this one with somthing else (ie settingsB ) when you need this later, oh yeah change the name here too ;) */
_global.settings = [{v:0, s:10}, {v:100, s: 20}];
/* divide the length of picArray by 2 & create that many containers,
then create containers a & b inside the new container */
for(i=0; i<(picArray.length/2); i++){
createEmptyMovieClip("box"+i,i);
this["box"+i].createEmptyMovieClip("a",0);
this["box"+i].createEmptyMovieClip("b",1);
}
/*From here we have theese objects/paths to work with,
box0 && box0.a && box0.b
box1 && box1.a && box1.b
box2 && box2.a && box2.b
ect..
*/
/* Now start the chain with the jpgLoadResize prototype,
0 being the associative array id for the first container & 10 being the padding between each container */
box0.jpgLoadResize(0,10);
/* Now we stop this movieclip from playing untill the prototype tells it to play */
stop();
picArray = ["pic1.jpg","pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg","pic6.jpg"];
/*create a "yin-yang" array with two objects for fade params, this array will get reversed ;) to alternate the fades. If you allready have a _global.settings declared from somthing else then make sure you replace this one with somthing else (ie settingsB ) when you need this later, oh yeah change the name here too ;) */
_global.settings = [{v:0, s:10}, {v:100, s: 20}];
/* divide the length of picArray by 2 & create that many containers,
then create containers a & b inside the new container */
for(i=0; i<(picArray.length/2); i++){
createEmptyMovieClip("box"+i,i);
this["box"+i].createEmptyMovieClip("a",0);
this["box"+i].createEmptyMovieClip("b",1);
}
/*From here we have theese objects/paths to work with,
box0 && box0.a && box0.b
box1 && box1.a && box1.b
box2 && box2.a && box2.b
ect..
*/
/* Now start the chain with the jpgLoadResize prototype,
0 being the associative array id for the first container & 10 being the padding between each container */
box0.jpgLoadResize(0,10);
/* Now we stop this movieclip from playing untill the prototype tells it to play */
stop();
- /*create a static array full of paths to JPGs, realistically this array would be filled with data from XML, but for examples sake this will do*/
- picArray = ["pic1.jpg","pic2.jpg","pic3.jpg","pic4.jpg","pic5.jpg","pic6.jpg"];
- /*create a "yin-yang" array with two objects for fade params, this array will get reversed ;) to alternate the fades. If you allready have a _global.settings declared from somthing else then make sure you replace this one with somthing else (ie settingsB ) when you need this later, oh yeah change the name here too ;) */
- _global.settings = [{v:0, s:10}, {v:100, s: 20}];
- /* divide the length of picArray by 2 & create that many containers,
- then create containers a & b inside the new container */
- for(i=0; i<(picArray.length/2); i++){
- createEmptyMovieClip("box"+i,i);
- this["box"+i].createEmptyMovieClip("a",0);
- this["box"+i].createEmptyMovieClip("b",1);
- }
- /*From here we have theese objects/paths to work with,
- box0 && box0.a && box0.b
- box1 && box1.a && box1.b
- box2 && box2.a && box2.b
- ect..
- */
- /* Now start the chain with the jpgLoadResize prototype,
- 0 being the associative array id for the first container & 10 being the padding between each container */
- box0.jpgLoadResize(0,10);
- /* Now we stop this movieclip from playing untill the prototype tells it to play */
- stop();
Ahora debemos insertar un nuevo fotograma clave en el fotograma 2 y darle este trozo de código,
Código: [ Select ]
//crossFade box0 (remember the settings2 we talked about ;) )
box0.crossFade(settings[0], settings[1]);
box0.crossFade(settings[0], settings[1]);
- //crossFade box0 (remember the settings2 we talked about ;) )
- box0.crossFade(settings[0], settings[1]);
Ahora, por cada caja que vamos a tener que insertar un nuevo fotograma clave 30 cuadros de la última (31,61) También tenemos que insertar un suplemento de 30 marcos de ese último por lo que no se inicia la decoloración hthe primer cuadro de la derecha después de la pasado, también será la inversión de la matriz de configuración de este último fotograma.
En cada uno de los fotogramas clave que hemos insertado en las casillas que añadimos las acciones antes mencionadas sólo cambiando el número se añade al final de la caja (box0, box1, box2, etc...)
En el último cuadro que tenemos la inversión de la matriz y gotoAndPlay (2) acciones,
Código: [ Select ]
// reverse the elements in the settings array ;)
_global.settings.reverse();
gotoAndPlay(2);
_global.settings.reverse();
gotoAndPlay(2);
- // reverse the elements in the settings array ;)
- _global.settings.reverse();
- gotoAndPlay(2);
BTW, este fla es <14KB y la película reúne a ser <1KB (890 bytes en mi máquina)
Strong with this one, the sudo is.
- plumbum01
- Newbie


- Registrado: Ago 11, 2004
- Mensajes: 12
- Status: Offline
wow, gracias por su apoyo. Realmente apreciar, pero todas las imágenes que añada en conjunto y no sé cómo modificar su tamaño. Puede descargar mi fuente para ver a qué me refiero:
http://dizaino.puslapiai.lt/myFade.rar
Lo siento, si mis preguntas son cojos, pero Im aprendizaje AC
http://dizaino.puslapiai.lt/myFade.rar
Lo siento, si mis preguntas son cojos, pero Im aprendizaje AC
- plumbum01
- Newbie


- Registrado: Ago 11, 2004
- Mensajes: 12
- Status: Offline
- joebert
- Sledgehammer


- Registrado: Feb 10, 2004
- Mensajes: 13455
- Loc: Florida
- Status: Offline
Encuentre esta línea,
el cambio de los 10 a un 6.
DONT cambiar el 0 (cero)
De que el 10 es el número de píxeles de espacio entre las imágenes, y la cantidad de espacio en la primera imagen desde el punto 0 _x del MC.
En cuanto al tamaño, agarrando los números que se encuentran por encima de esta línea en el jpgLoadResize (prototipo,
Inmediatamente después de que hay una this.b._alpha = 0;
Después de esta línea alfa y suponiendo que se trata exclusivamente del mismo tamaño, añadir estas líneas,
Im adivinar que estos van a ser vistas en miniatura?
Código: [ Select ]
box0.jpgLoadResize(0,10);
De que el 10 es el número de píxeles de espacio entre las imágenes, y la cantidad de espacio en la primera imagen desde el punto 0 _x del MC.
En cuanto al tamaño, agarrando los números que se encuentran por encima de esta línea en el jpgLoadResize (prototipo,
Código: [ Select ]
if(this.a._width > 1 && this.b._width > 1){
/*set the alpha of b so there is no "fishtank time" */
/*set the alpha of b so there is no "fishtank time" */
- if(this.a._width > 1 && this.b._width > 1){
- /*set the alpha of b so there is no "fishtank time" */
Inmediatamente después de que hay una this.b._alpha = 0;
Después de esta línea alfa y suponiendo que se trata exclusivamente del mismo tamaño, añadir estas líneas,
Código: [ Select ]
this.a._width = 162;
this.a._height = 113;
this.b._width = 162;
this.b._height = 113;
this.a._height = 113;
this.b._width = 162;
this.b._height = 113;
- this.a._width = 162;
- this.a._height = 113;
- this.b._width = 162;
- this.b._height = 113;
Im adivinar que estos van a ser vistas en miniatura?
Strong with this one, the sudo is.
- plumbum01
- Newbie


- Registrado: Ago 11, 2004
- Mensajes: 12
- Status: Offline
- Anonymous
- Bot


- Registrado: 25 Feb 2008
- Mensajes: ?
- Loc: Ozzuland
- Status: Online
Agosto 13th, 2004, 4:59 am
1, 2
Para responder a este tema que necesita para ingresar o registrarse. Es gratis.
Publicar Información
- Total de mensajes en este tema: 17 mensajes
- Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 50 invitados
- No puede abrir nuevos temas en este Foro
- No puede responder a temas en este Foro
- No puede editar sus mensajes en este Foro
- No puede borrar sus mensajes en este Foro
- No puede enviar adjuntos en este Foro
