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

**URL:** <https://forum.kirupa.com/t/who-can-help-me-to-get-this-mx-as-alpha-img-fade-to-work-for-flash5/9779>\
**Category:** Uncategorized\
**Created:** [December 18, 2002, 12:10pm UTC](https://forum.kirupa.com/t/who-can-help-me-to-get-this-mx-as-alpha-img-fade-to-work-for-flash5/9779 "2002-12-18T12:10:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericinho](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@ericinho](https://forum.kirupa.com/u/ericinho)\
**Post date:** [December 18, 2002, 12:10pm UTC](https://forum.kirupa.com/t/who-can-help-me-to-get-this-mx-as-alpha-img-fade-to-work-for-flash5/9779/1 "2002-12-18T12:10:44Z")

</div>

please take a look at this thread at the [Actionscript.org](http://Actionscript.org) boards:

[http://www.actionscript.net/forums/showthread.php3?s=&threadid=19983](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.

```php
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 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 18, 2002, 12:21pm UTC](https://forum.kirupa.com/t/who-can-help-me-to-get-this-mx-as-alpha-img-fade-to-work-for-flash5/9779/2 "2002-12-18T12:21:50Z")

</div>

Reading your reply on [actionscript.net](http://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!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 18, 2002, 12:56pm UTC](https://forum.kirupa.com/t/who-can-help-me-to-get-this-mx-as-alpha-img-fade-to-work-for-flash5/9779/3 "2002-12-18T12:56:13Z")

</div>

lol

I’ll kindly disregard you 🙂

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

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 18, 2002, 1:25pm UTC](https://forum.kirupa.com/t/who-can-help-me-to-get-this-mx-as-alpha-img-fade-to-work-for-flash5/9779/4 "2002-12-18T13:25:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 18, 2002, 1:49pm UTC](https://forum.kirupa.com/t/who-can-help-me-to-get-this-mx-as-alpha-img-fade-to-work-for-flash5/9779/5 "2002-12-18T13:49:51Z")

</div>

mmm ☹

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???
