# Calling a function in a movieclip

**URL:** <https://forum.kirupa.com/t/calling-a-function-in-a-movieclip/155536>\
**Category:** Uncategorized\
**Created:** [July 18, 2005, 6:36pm UTC](https://forum.kirupa.com/t/calling-a-function-in-a-movieclip/155536 "2005-07-18T18:36:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ro\_core](https://avatars.discourse-cdn.com/v4/letter/r/b38774/32.png) [@ro\_core](https://forum.kirupa.com/u/ro_core)\
**Post date:** [July 18, 2005, 6:36pm UTC](https://forum.kirupa.com/t/calling-a-function-in-a-movieclip/155536/1 "2005-07-18T18:36:24Z")

</div>

I want to call a function that I define in a movieclip so that I can access the variables in the movieclip.

So, outside of the movieclip I want to do mc.myfunc(4, 5) and then the movieclip has a function called ‘mc’ that takes two arguments. How to do this? I have tried defining functions in the first frame of the mc but to no effect.

I’m using attachMovie so that may be why I can’t call myfunc, so how to get around it?

Thanks!
