# Function help - myFunction(params1, params2);

**URL:** <https://forum.kirupa.com/t/function-help-myfunction-params1-params2/311837>\
**Category:** flash\
**Created:** [July 17, 2010, 7:08pm UTC](https://forum.kirupa.com/t/function-help-myfunction-params1-params2/311837 "2010-07-17T19:08:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jany](https://avatars.discourse-cdn.com/v4/letter/j/ce7236/32.png) [@jany](https://forum.kirupa.com/u/jany)\
**Post date:** [July 17, 2010, 7:08pm UTC](https://forum.kirupa.com/t/function-help-myfunction-params1-params2/311837/1 "2010-07-17T19:08:57Z")

</div>

Sending params through a function is no problemo. But I saw once, a way to have a function all set up to receive the params, yet if something is sent through that doesn’t match the params, or nothing is sent through, the function still fires off without giving you an error.

For example -

```auto
function myFunction(params1:MovieClip, params2:TextField)

```

So now, if I wanted to use that function, I would write -

```auto
myFunction(MC, tField)

```

where MC = a MovieClip and where tField = a TextField

Great, so that all works. But I once saw a way where you can have the function set up like this

```auto
myFunction(params1:MovieClip != null, params2:TextField)

```

So that if I were to send just the TextField (in this case) to the function, it would still fire off and work, it just wouldn’t account for anything I didn’t send it.

Of course it wasn’t just like that, or else it would work for me, but I saw the NULL in there somewhere, within the function and it worked so nicely.

Anyone have any ideas?

ty 🅱:write:
