# Calling a mouse event handler without the event

**URL:** https://forum.kirupa.com/t/calling-a-mouse-event-handler-without-the-event/292403
**Category:** flash
**Created:** [July 14, 2009, 2:59am UTC](https://forum.kirupa.com/t/calling-a-mouse-event-handler-without-the-event/292403 "2009-07-14T02:59:52Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![andrewlong](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@andrewlong](https://forum.kirupa.com/u/andrewlong)
#### Post date: [July 14, 2009, 2:59am UTC](https://forum.kirupa.com/t/calling-a-mouse-event-handler-without-the-event/292403/1 "2009-07-14T02:59:52Z")

</div>

I am writing a program that needs to go to a random frame after clicking a button. However, the program also needs to start on a random frame. When I call the function at the start of the program it gives me an 1120: Access of undefined property event error. The function is originally written as followed:

function randomMatchedTrial(event:MouseEvent) {  
… lots of code that probably doesnt matter, but let me know if it does…  
}

the program starts by calling the function as followed:

randomMatchedTrial(event)

Can event handler functions be called outside of the event listeners they are handling?
