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):
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:
on(rollOver){
Brass();
}
That is about it. How come it doesn’t work? I know that I am close…