# Call a function inside a movieclip

**URL:** <https://forum.kirupa.com/t/call-a-function-inside-a-movieclip/329137>\
**Category:** Uncategorized\
**Created:** [July 25, 2012, 5:02am UTC](https://forum.kirupa.com/t/call-a-function-inside-a-movieclip/329137 "2012-07-25T05:02:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkk](https://avatars.discourse-cdn.com/v4/letter/t/3bc359/32.png) [@tkk](https://forum.kirupa.com/u/tkk)\
**Post date:** [July 25, 2012, 5:02am UTC](https://forum.kirupa.com/t/call-a-function-inside-a-movieclip/329137/1 "2012-07-25T05:02:48Z")

</div>

Hi, I have a simple problem. I have a lengthy function declared on the first frame of my game, I would like to use this as code for the enemies, therefore I must call it inside their enterFrame section.  
This is how I am trying to call it now:

onClipEvent (enterFrame) {  
monsterScript(0, 1, “left”, 5, 5, 1, 1);  
}

And I get nothing. However, interestingly enough, I know it’s not a problem with the function itself, because if I target the call to the root layer (I.E. \_root.monsterScript(0, 1, “left”, 5, 5, 1, 1)) the whole screen begins behaving the way the monster should.
