# Simple fade in and out function?

**URL:** <https://forum.kirupa.com/t/simple-fade-in-and-out-function/241881>\
**Category:** flash\
**Created:** [October 19, 2007, 3:05am UTC](https://forum.kirupa.com/t/simple-fade-in-and-out-function/241881 "2007-10-19T03:05:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RichGags](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/richgags/32/685_2.png) [@RichGags](https://forum.kirupa.com/u/RichGags)\
**Post date:** [October 19, 2007, 3:05am UTC](https://forum.kirupa.com/t/simple-fade-in-and-out-function/241881/1 "2007-10-19T03:05:04Z")

</div>

Can someone help me with a function that I can re-use and pass movie clips to and cause mc’s to fade in and out?..such as

```auto
function fadeMeIn(fadewhat,fadespeed) {

if (fadewhat < 100) {
fadewhat._alpha += fadespeed;

};

and call it something like this?

_root.fadeMeIn(_root.mypages, 5)

```

Obviously not the correct code, but you get what Im trying to do. Instead of useing motion tweens with alpha, Id rather just do it with actionscript whenever I need to fade something in or out. Any ideas?

Thanks!  
Rich
