# Call function in other .as file

**URL:** <https://forum.kirupa.com/t/call-function-in-other-as-file/299095>\
**Category:** flash\
**Created:** [October 29, 2009, 5:28pm UTC](https://forum.kirupa.com/t/call-function-in-other-as-file/299095 "2009-10-29T17:28:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Defeatist](https://avatars.discourse-cdn.com/v4/letter/d/edb3f5/32.png) [@Defeatist](https://forum.kirupa.com/u/Defeatist)\
**Post date:** [October 29, 2009, 5:28pm UTC](https://forum.kirupa.com/t/call-function-in-other-as-file/299095/1 "2009-10-29T17:28:49Z")

</div>

In short: how can i call a function in another .as file? Is there a way to make header files or forward declarations in AS3?

Output

```auto

BREAKPOINT1
1061: Call to a possibly undefined method playerCharMove
through a reference with static type Class.

```

game.fla layer 1 frame 1

```auto

import Core;
import playerChar;

```

Core.as

```auto
package
{
     import flash.display.MovieClip;
    import flash.events.*;
    import flash.utils.*; 
     
    public class Core extends MovieClip {

        public function Core() {
            addEventListener(Event.ENTER_FRAME,moveChar);
        }

        public function moveChar(event:Event) {
            trace("BREAKPOINT1")
            playerChar.playerCharMove();
            removeEventListener(Event.ENTER_FRAME,moveChar)
        }

    }
    
}

```

playerChar.as

```auto
package
{
     import flash.display.MovieClip;
    import flash.events.*;

public class playerChar extends MovieClip                  
    {    
        public function playerCharMove() 
        {
            trace("BREAKPOINT2")
        }
    }
}

```
