# My function wont work!

**URL:** <https://forum.kirupa.com/t/my-function-wont-work/132915>\
**Category:** Uncategorized\
**Created:** [January 3, 2005, 5:38pm UTC](https://forum.kirupa.com/t/my-function-wont-work/132915 "2005-01-03T17:38:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulsully](https://avatars.discourse-cdn.com/v4/letter/p/a88e4f/32.png) [@paulsully](https://forum.kirupa.com/u/paulsully)\
**Post date:** [January 3, 2005, 5:38pm UTC](https://forum.kirupa.com/t/my-function-wont-work/132915/1 "2005-01-03T17:38:51Z")

</div>

would someone help me? please? i’m stuck.  
I have been trying for hours to figure out how to use this function to change an objects alpha from 1 to 100 to make it fade in.  
the object is named ‘box’,  
there is a button which calls the function.

function fadein(){  
z = 1;  
while ( z \< 100 ){  
\_root.box.\_alpha = z;  
z = z+1;  
}  
}

why wont this work? any ideas anyone, im a newbie to scripting.

here is the fla [http://www.sullyworld.co.uk/flash/fader.fla](http://www.sullyworld.co.uk/flash/fader.fla)
