Groups | Blog | Home
all groups > flash actionscript > january 2004 >

flash actionscript : looking for a smarter way to just display sequencial images


Bartman
1/22/2004 10:39:12 PM
Hi,

Usually I'd just create a new movie clip symbol and put all my images into that, fading the 1st in, let it go for a couple seconds, fade it out, and fade the next one in and so on down the line.....

There's gotta be a better/smarter way to do this.... can anyone shed some light on this? Thanks in advance....

Jack.
1/22/2004 10:56:01 PM
you can load non progressive jpegs, hold their names in an array,

arr=["pic0","pic1","pic2","pic3","pic4","pic5"];
upSpeed = 2; downSpeed = 3;

function fader(dir){
if (dir == "up"){
this.createEmptyMovieClip("loadr",123);
loadr._x = 220; loadr._y = 115;
loadr.loadMovie(arr[pic]+".jpg");
loadr._alpha = 1; pic++;
this.onEnterframe = function(){ fadeUp(upSpeed);};
}else
this.onEnterframe = function(){ fadeDn(downSpeed);
pic > arr.length-1 ? pic=0 : null; };
};
/**************/
function fadeUp(sp){
if(loadr._alpha >= 98) hold(4000);
if(timer) fader("dn");
else
loadr._alpha += sp; trace(int(loadr._alpha));
loadr._alpha > 98 ? loadr._alpha = 99 : null;
};
/**************/
function fadeDn(sp){
if(loadr._alpha <= 1){
timer = 0; fader("up");
} else
loadr._alpha -= sp; trace(int(loadr._alpha));
};
/**************/
function hold(mSecs){
if(!pause){
pause = getTimer() + mSecs; trace("paused");
} else if (getTimer() > pause){
pause = 0; timer = 1;
}
};
/* initialize */
pic=0; fader("up");

regards
PierreAlain
1/23/2004 1:29:47 AM
many way, but to stay simple, just to mix the images :

1) first image
2) fading the second one
3) quite at the same time fading out the first one
4) second image
....
that just a tiny change to what you did. Many other way, as caches,
pushing....

--

Pierre Alain

pie@lifnet.com


"Bartman" <webforumsuser@macromedia.com> a écrit dans le message de
news:bupjeg$18b$1@forums.macromedia.com...
[quoted text, click to view]
that, fading the 1st in, let it go for a couple seconds, fade it out, and
fade the next one in and so on down the line.....
[quoted text, click to view]

AddThis Social Bookmark Button