# Functions?

**URL:** <https://forum.kirupa.com/t/functions/214745>\
**Category:** flash\
**Created:** [January 31, 2007, 5:39pm UTC](https://forum.kirupa.com/t/functions/214745 "2007-01-31T17:39:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Macsy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/macsy/32/3238_2.png) [@Macsy](https://forum.kirupa.com/u/Macsy)\
**Post date:** [January 31, 2007, 5:39pm UTC](https://forum.kirupa.com/t/functions/214745/1 "2007-01-31T17:39:09Z")

</div>

:cantlook:Figured out you are good at Flash 🙂 So heres is another task.

Lets say that i want to do falling balls on my Scene.  
These balls all uses the same AS and at somehow i should use a function that i declare myself at frame 1 in my scene. Ive tried, over and over and over again different ways. But i dont know how to use functions.

function = fall(){  
\_y += 1  
if (\_y \> 500)  
{  
\_y = 0  
}  
}

In my world that seems like a fair code for my falling ball.  
On my ball i add  
onClipEvent(enterFrame){  
fall()  
}  
:cantlook:  
But that is not correct. Can somebody please help me out? 🙂 ( My problem is not to get a falling ball, lets say i want to make 2999 falling balls with dublicateMovieClip, etc) :))
