# How to pass in value to function?

**URL:** <https://forum.kirupa.com/t/how-to-pass-in-value-to-function/307626>\
**Category:** flash\
**Created:** [April 7, 2010, 5:39am UTC](https://forum.kirupa.com/t/how-to-pass-in-value-to-function/307626 "2010-04-07T05:39:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nananya](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@nananya](https://forum.kirupa.com/u/nananya)\
**Post date:** [April 7, 2010, 5:39am UTC](https://forum.kirupa.com/t/how-to-pass-in-value-to-function/307626/1 "2010-04-07T05:39:38Z")

</div>

Hi all,I am new to here and I got a question about how to pass in value to the function.  
I am using CS4 and AS2.  
This is my code:

> 

attachMovie(“platform”,“platform0”,1);  
platform0.\_x = 300;  
platform0.\_y = 600;  
platform0.onEnterFrame = a(0);

> 

function a(num)  
{  
this.\_y -= 2;  
if(this.\_y \< 800)  
{  
if (man1.hitTest(this))  
{  
name = eval(“platfrom”+(num+1));  
man1.\_y = this.\_y - man1.\_height;  
man1.onPlatform = true;  
drop();  
}  
if (man1.\_x \< this.\_x-(man1.\_width/2))  
{  
man1.onPlatform = false;  
drop();  
}  
if (man1.\_x+man1.\_width \> this.\_x + this.\_width+(man1.\_width/2))  
{  
man1.onPlatform = false;  
drop();  
}  
if (this.\_y \< 0)  
{  
this.removeMovieClip();  
}  
}  
}

I try to pass in this but it fail.  
Can anyone help me to solve this question?  
Thank you.
