# Call a function with actionscript 2?

**URL:** https://forum.kirupa.com/t/call-a-function-with-actionscript-2/300773
**Category:** Uncategorized
**Created:** [November 27, 2009, 2:50am UTC](https://forum.kirupa.com/t/call-a-function-with-actionscript-2/300773 "2009-11-27T02:50:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pumpkin05](https://avatars.discourse-cdn.com/v4/letter/p/b4bc9f/32.png) [@pumpkin05](https://forum.kirupa.com/u/pumpkin05)
#### Post date: [November 27, 2009, 2:50am UTC](https://forum.kirupa.com/t/call-a-function-with-actionscript-2/300773/1 "2009-11-27T02:50:42Z")

</div>

Hi Guys,

I am trying to remove a mouse listener from a function created from a tutorial in actionscript 2:

Mouse.addListener(mousecontroll);  
onEnterFrame = oef; //main function: handles page turning-------------------------------------------------------------------------------------  
resetPages();  
reset();

function removeML() { //removes mouse listener  
//Call this function before unloading the pageflip  
//if you don’t do that, the next time you load a  
//pageflip, the mouselistener will not work!  
Mouse.removeListener(mousecontroll);  
trace(“removed”);  
}

The swf that the function is within I am uploading externally into a container.

The code for the button that i am using to try and call the function and load the external swf is below:

on (release)  
{  
\_root.holder\_mc.loadMovie(“external.swf”, \_root.holder);  
\_root.button\_mc.onRelease = removeML; //this line of code doesn’t seem to call the function  
}

Any advice or help would be much appreciated.

Cheers.
