# Using external action script files

**URL:** <https://forum.kirupa.com/t/using-external-action-script-files/84128>\
**Category:** flash\
**Created:** [March 24, 2005, 8:26pm UTC](https://forum.kirupa.com/t/using-external-action-script-files/84128 "2005-03-24T20:26:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![innovations](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/innovations/32/1200_2.png) [@innovations](https://forum.kirupa.com/u/innovations)\
**Post date:** [March 24, 2005, 8:26pm UTC](https://forum.kirupa.com/t/using-external-action-script-files/84128/1 "2005-03-24T20:26:59Z")

</div>

How do you call functions that are located in an external .as file?

I created an action script file that I have saved in the same directory as my swf. In the file I have two functions that I would like to be able to call in my swf when someone rolls over a button.

Here is my .as file (Rollover.as):

```auto
class Rollover extends MovieClip {
function Brass() { // function for loading the brass symbol sound
brass = new Sound(this);
brass.attachSound("brass_click");
brass.start(0, 0);
}
function Thoup() { // function for loading the thoup sound
brass = new Sound(this);
brass.attachSound("thoup_click");
brass.start(0, 0);
}
}

```

Within my swf I have two mp3 files, brass\_click.mp3 and thoup\_click.mp3, and I have set their linkage properties to “export to actionscript” with their respective names. I also have a set of buttons that I would like to play the mp3 files on rollover.

On my buttons I have the following code:

```auto
on(rollOver){
Brass();
}

```

That is about it. How come it doesn’t work? I know that I am close…
