Fading effet, avec six images
- plumbum01
- Newbie


- Inscription: Aoû 11, 2004
- Messages: 12
- Status: Offline
Bonjour à tous! Im de nouveau dans ce forum et même dans actionscripting, mais j'ai un problème et j'espère que vous les gars vont m'aider.
J'ai besoin de faire cette animation, mais j'ai problème avec fade in et fade out.
http://www.verus.lt/images/main.swf
Comme vous pouvez le voir:
1. première image dans la première colonne disparaît
2. seconde image s'estompe, et attend jusqu'à la seconde image dans la troisième colonne s'estompe dans
3. première image dans la deuxième colonne disparaît........ ect
Je pense que je dois utiliser des fonctions et setInterval, mais rien ne se passe...
Donc, je pense, vous comprendrez tout, ce que je voulais dire...
J'ai besoin de faire cette animation, mais j'ai problème avec fade in et fade out.
http://www.verus.lt/images/main.swf
Comme vous pouvez le voir:
1. première image dans la première colonne disparaît
2. seconde image s'estompe, et attend jusqu'à la seconde image dans la troisième colonne s'estompe dans
3. première image dans la deuxième colonne disparaît........ ect
Je pense que je dois utiliser des fonctions et setInterval, mais rien ne se passe...
Donc, je pense, vous comprendrez tout, ce que je voulais dire...
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Août 11th, 2004, 2:57 am
- digitalMedia
- a.k.a. dM


- Inscription: Déc 29, 2003
- Messages: 5169
- Loc: SC-USA
- Status: Offline
Vous n'avez pas à utiliser des fonctions, pour / boucles prochain, si les déclarations, les propriétés ou _alpha setInterval, mais que celle-ci vous aidera.

Je ne comprends pas votre question. C'est une chose très simple à réaliser. Où êtes-vous coincé? S'il vous plaît être plus précis.
Je ne comprends pas votre question. C'est une chose très simple à réaliser. Où êtes-vous coincé? S'il vous plaît être plus précis.
- dM
- joebert
- Sledgehammer


- Inscription: Fév 10, 2004
- Messages: 13455
- Loc: Florida
- Status: Offline
Heres une façon de s'en tirer,
Crossfade
N'hésitez pas à signaler tout ce que vous ne comprenez pas
FLA Source (pas MX 2004) avec des images dans la bibliothèque
/ / Modifier
avait le mauvais lien.
Le débit est fixé à 20fps, la première image contient les actions ci-dessus est joué pour initialiser tout ce qui est alors jamais vu de nouveau, à partir de l'image 2 toutes les 30 images il ya un,
qui déclenche l'a et b MCs dans le contenant des boîtes qui se fanent au niveau oppisite qu'il est à présent.
dans la membrure 91 il ya,
Le passage de première ligne () s les premiers réglages objet hors du tableau des paramètres et depuis shift () retourne un tableau d'ING l'élément qui le supprime, on pousse () ce qui est retourné à la fin du tableau (d'où le yin-yang )
La deuxième ligne contient suffisamment d'expliquer gif "alt =": wink: "title =" Wink "/> le film à cause de droit de retour en arrière et l'image 2 et recommencer à nouveau, cette fois les valeurs du tableau des paramètres sont inversés (Il ya une méthode reverse () pour les tableaux, de cette façon est bon de savoir si
. oO (ok donc j'ai oublié sur la méthode inverse gif "alt =": P "title =" Razz "/> )) Soooo, maintenant avec les paramètres a renversé la a & b mcs intérieur de la boîte #conteneurs va s'estomper dans les directions oppisite cette fois (et chaque itération par la suite)
Crossfade
N'hésitez pas à signaler tout ce que vous ne comprenez pas
FLA Source (pas MX 2004) avec des images dans la bibliothèque
/ / Modifier
Code: [ 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}];
Le débit est fixé à 20fps, la première image contient les actions ci-dessus est joué pour initialiser tout ce qui est alors jamais vu de nouveau, à partir de l'image 2 toutes les 30 images il ya un,
Code: [ Select ]
box#.crossFade(settings[0], settings[1]);
qui déclenche l'a et b MCs dans le contenant des boîtes qui se fanent au niveau oppisite qu'il est à présent.
dans la membrure 91 il ya,
Code: [ Select ]
settings.push(settings.shift());
gotoAndPlay(2);
gotoAndPlay(2);
- settings.push(settings.shift());
- gotoAndPlay(2);
Le passage de première ligne () s les premiers réglages objet hors du tableau des paramètres et depuis shift () retourne un tableau d'ING l'élément qui le supprime, on pousse () ce qui est retourné à la fin du tableau (d'où le yin-yang )
La deuxième ligne contient suffisamment d'expliquer gif "alt =": wink: "title =" Wink "/> le film à cause de droit de retour en arrière et l'image 2 et recommencer à nouveau, cette fois les valeurs du tableau des paramètres sont inversés (Il ya une méthode reverse () pour les tableaux, de cette façon est bon de savoir si
Strong with this one, the sudo is.
- plumbum01
- Newbie


- Inscription: Aoû 11, 2004
- Messages: 12
- Status: Offline
- joebert
- Sledgehammer


- Inscription: Fév 10, 2004
- Messages: 13455
- Loc: Florida
- Status: Offline
- plumbum01
- Newbie


- Inscription: Aoû 11, 2004
- Messages: 12
- Status: Offline
- joebert
- Sledgehammer


- Inscription: Fév 10, 2004
- Messages: 13455
- Loc: Florida
- Status: Offline
l'importation que dans loadMovie () les droits d'importation?
Placez ce dans un nouveau mC, swap de attachMovie () avec loadMovie () et jouer une fois toutes les images sont chargées.
Id donner un exemple, mais je ne peux pas voir comment, sans que vous importez les images.
edit / / puis de nouveau, que d'images que vous utilisez, peut-être à modifier certains numéros ainsi
Placez ce dans un nouveau mC, swap de attachMovie () avec loadMovie () et jouer une fois toutes les images sont chargées.
Id donner un exemple, mais je ne peux pas voir comment, sans que vous importez les images.
edit / / puis de nouveau, que d'images que vous utilisez, peut-être à modifier certains numéros ainsi
Strong with this one, the sudo is.
- plumbum01
- Newbie


- Inscription: Aoû 11, 2004
- Messages: 12
- Status: Offline
Oui, j'utilise loadMovie (). Je vous remercie de m'avoir aidé à joebert 
AC dans la première image:
AC dans la première image:
Code: [ 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


- Inscription: Fév 10, 2004
- Messages: 13455
- Loc: Florida
- Status: Offline
- plumbum01
- Newbie


- Inscription: Aoû 11, 2004
- Messages: 12
- Status: Offline
- joebert
- Sledgehammer


- Inscription: Fév 10, 2004
- Messages: 13455
- Loc: Florida
- Status: Offline
Im sorry tard, Son été une rude journée....
heres a loadMovie version
Heres the source (theres presque autant de commentaires que le code
)
Heres a regarder les choses avant d'ouvrir Flash gif "alt =";)" title =" Wink "/>
Il s'agit de la première image du scénario principal, seule nouveauté ici est la jpgLoadResize (qui devrait être loadposition () mais j'ai eu un brainfart quand il fait)
Maintenant, pour le rendre facile, nous créons un nouveau symbole avec rien dedans mais les actions qui font référence à des choses dedans et utiliser les prototypes d'en haut. (pourquoi ne pas mettre les prototypes à l'intérieur du stmbol demandez-vous? les mettre à la racine, il est plus facile de les trouver pour référence si nous avons somthing d'autre qui veut les utiliser)
Or, dans la première image-clé (qui devrait être le seul en ce moment
), Nous avons ces actions à mettre les choses en place.
Maintenant, nous insérer une nouvelle image-clé à la frame 2 et lui donner ce morceau de code,
Maintenant, pour chaque boîte que nous allons devoir nous insérer une nouvelle image clé de 30 images de la dernière (31,61) Nous avons également besoin d'insérer un extra de 30 images à partir de cette dernière de sorte qu'il ne démarre pas en déclin hthe à droite après la première case Enfin, nous allons aussi être inverser le tableau des paramètres dans ce dernier cadre.
Dans chacune des images-clés que nous avons inséré pour les boîtes l'on ajoute les actions ci-dessus en changeant simplement le nombre ajouté à la fin de la boîte (box0, box1, encadré 2, ect...)
Dans le dernier cadre que nous avons l'inversion array & le gotoAndPlay (2) des actions,
BTW, ce fla est <14KB & le film compile to be <1 Ko (890 octets sur ma machine)
heres a loadMovie version
Heres the source (theres presque autant de commentaires que le code
Heres a regarder les choses avant d'ouvrir Flash gif "alt =";)" title =" Wink "/>
Il s'agit de la première image du scénario principal, seule nouveauté ici est la jpgLoadResize (qui devrait être loadposition () mais j'ai eu un brainfart quand il fait)
Code: [ 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;
- }
- }
- }
Maintenant, pour le rendre facile, nous créons un nouveau symbole avec rien dedans mais les actions qui font référence à des choses dedans et utiliser les prototypes d'en haut. (pourquoi ne pas mettre les prototypes à l'intérieur du stmbol demandez-vous? les mettre à la racine, il est plus facile de les trouver pour référence si nous avons somthing d'autre qui veut les utiliser)
Or, dans la première image-clé (qui devrait être le seul en ce moment
Code: [ 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();
Maintenant, nous insérer une nouvelle image-clé à la frame 2 et lui donner ce morceau de code,
Code: [ 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]);
Maintenant, pour chaque boîte que nous allons devoir nous insérer une nouvelle image clé de 30 images de la dernière (31,61) Nous avons également besoin d'insérer un extra de 30 images à partir de cette dernière de sorte qu'il ne démarre pas en déclin hthe à droite après la première case Enfin, nous allons aussi être inverser le tableau des paramètres dans ce dernier cadre.
Dans chacune des images-clés que nous avons inséré pour les boîtes l'on ajoute les actions ci-dessus en changeant simplement le nombre ajouté à la fin de la boîte (box0, box1, encadré 2, ect...)
Dans le dernier cadre que nous avons l'inversion array & le gotoAndPlay (2) des actions,
Code: [ 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, ce fla est <14KB & le film compile to be <1 Ko (890 octets sur ma machine)
Strong with this one, the sudo is.
- plumbum01
- Newbie


- Inscription: Aoû 11, 2004
- Messages: 12
- Status: Offline
wow, je vous remercie pour votre soutien. J'ai vraiment apprécier, mais toutes les images que vous ajoutez au tableau et je ne sais pas comment redimensionner. Vous pouvez télécharger ma source pour voir ce que je veux dire:
http://dizaino.puslapiai.lt/myFade.rar
Désolé si mes questions sont boiteux, mais Im apprentissage AC
http://dizaino.puslapiai.lt/myFade.rar
Désolé si mes questions sont boiteux, mais Im apprentissage AC
- plumbum01
- Newbie


- Inscription: Aoû 11, 2004
- Messages: 12
- Status: Offline
- joebert
- Sledgehammer


- Inscription: Fév 10, 2004
- Messages: 13455
- Loc: Florida
- Status: Offline
Trouvez cette ligne,
changement des 10 à un 6.
EXCLURE changer le 0 (zéro)
Que 10 est le nombre de pixels à l'espace entre les images, et le montant à l'espace de la première image du point 0 _x du MC.
Quant à la redimensionner, saisissant les chiffres que vous avez trouver au-dessus de cette ligne dans le jpgLoadResize (prototype,
Tout de suite après qu'il y ait un this.b._alpha = 0;
Après cette ligne alpha et en supposant que ces seront tous de la même taille, ajoutez ces lignes,
Im guessing ces vont être vignettes?
Code: [ Select ]
box0.jpgLoadResize(0,10);
Que 10 est le nombre de pixels à l'espace entre les images, et le montant à l'espace de la première image du point 0 _x du MC.
Quant à la redimensionner, saisissant les chiffres que vous avez trouver au-dessus de cette ligne dans le jpgLoadResize (prototype,
Code: [ 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" */
Tout de suite après qu'il y ait un this.b._alpha = 0;
Après cette ligne alpha et en supposant que ces seront tous de la même taille, ajoutez ces lignes,
Code: [ 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 guessing ces vont être vignettes?
Strong with this one, the sudo is.
- plumbum01
- Newbie


- Inscription: Aoû 11, 2004
- Messages: 12
- Status: Offline
- Anonymous
- Bot


- Inscription: 25 Feb 2008
- Messages: ?
- Loc: Ozzuland
- Status: Online
Août 13th, 2004, 4:59 am
1, 2
Pour répondre à ce sujet, vous devez vous connecter ou vous enregistrer. Il est gratuit.
Afficher de l'information
- Total des messages de ce sujet: 17 messages
- Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 74 invités
- Vous ne pouvez pas poster de nouveaux sujets
- Vous ne pouvez pas répondre aux sujets
- Vous ne pouvez pas éditer vos messages
- Vous ne pouvez pas supprimer vos messages
- Vous ne pouvez pas joindre des fichiers
