Who can help me to get this Mx AS (alpha img fade) to work for Flash5?

please take a look at this thread at the Actionscript.org boards:

http://www.actionscript.net/forums/showthread.php3?s=&threadid=19983

the AS described by pixelwit is exactly what I am looking for, but then for Flash5.

var step = 10;
var oldClip;
function fadeOut(){
        this._alpha-=step;
        if(this._alpha<=0){
                this._alpha = 0;
                this._visible = false;
                this.onEnterFrame = null;
        }
}
function fadeIn(){
        this._alpha+=step;
        if(this._alpha>=100){
                this._alpha = 100;
                this.onEnterFrame = null;
        }
}
function showClip(newClip){
        if (newClip!=oldClip){
                var n = newClip;
                var o = oldClip;
                newClip._visible = true;
                n.onEnterFrame = function(){
                        fadeIn.call(n);
                }
                o.onEnterFrame = function(){
                        fadeOut.call(o);
                }
                oldClip = newClip;
        }
}

He included an .fla, but unfortunately both are Mx.

Can anyone tell me how to change this script, so it works for Flash 5+ ???

Thanks :slight_smile:

Reading your reply on actionscript.net, it looks like you got it working. Especially after visiting your site. And if that isn’t your site , and your comments, then disregard me!

lol

I’ll kindly disregard you :slight_smile:

no, none of the people in that thread are in any way related to me :wink:

apart from that, it is a MX solution, and I hope that someone knows how to change that MX gall, in to a sexy Flash 5 script.

Nice cood :o
Unfortunately, and as Pixelwit said in one of the thread, it’s a real pain in the butt to do that kind of things with Flash 5.

mmm :frowning:

is there perhaps a different way to get a simular result?

looking at the code I guess that only the onEnterFrame is Mx, right?

If I think about it, all that need to be coded is… :crazy:

  • a var in which the current image is set
  • a function which checks what image/mc is in the var
  • a function which says something like this:
    on release load/move new image to layer/level below current image (which is on toplevel);
    set the current image (as set in var) gradually to 0% alpha
    and as last move new loaded image to toplevel…

(all images would be put in an SWF which would be loaded into the main SWF)

unfortunately my AS knowledge is fairly limited, so I have no clue how to script this???

anyone an idea???