# How to call a function on the main timeline

**URL:** https://forum.kirupa.com/t/how-to-call-a-function-on-the-main-timeline/298385
**Category:** flash
**Created:** [October 17, 2009, 9:56pm UTC](https://forum.kirupa.com/t/how-to-call-a-function-on-the-main-timeline/298385 "2009-10-17T21:56:33Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![alucardac](https://avatars.discourse-cdn.com/v4/letter/a/3da27b/32.png) [@alucardac](https://forum.kirupa.com/u/alucardac)
#### Post date: [October 17, 2009, 9:56pm UTC](https://forum.kirupa.com/t/how-to-call-a-function-on-the-main-timeline/298385/1 "2009-10-17T21:56:33Z")

</div>

I have a button in a movieclip and im trying to tell it to call a function on the main timeline. How do I do this? root something?

Here is the function on the main timeline im trying to call

```auto

function hallwaylurkerload (evt:MouseEvent):void {
var currentGalleryID:int = 1;
loader.load(new URLRequest(galleries[currentGalleryID][0]));
}

```

and here is the code inside the movieclip

```auto

stop();
apartmentlurker.addEventListener(MouseEvent.CLICK, hallwaylurkerload);

```
