# addEventListener with variables

**URL:** https://forum.kirupa.com/t/addeventlistener-with-variables/277592
**Category:** Uncategorized
**Created:** [December 14, 2008, 11:39am UTC](https://forum.kirupa.com/t/addeventlistener-with-variables/277592 "2008-12-14T11:39:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Wampiro\_UHA](https://avatars.discourse-cdn.com/v4/letter/w/eb9ed0/32.png) [@Wampiro\_UHA](https://forum.kirupa.com/u/Wampiro_UHA)
#### Post date: [December 14, 2008, 11:39am UTC](https://forum.kirupa.com/t/addeventlistener-with-variables/277592/1 "2008-12-14T11:39:55Z")

</div>

I would like to create an evenListener for my menu, so when clicking on different buttons I load content (MovieClips) into a MC called Content.

I don’t know how to pass on variables with my function handleMouseUp or how to onload already (if any) MC in Content.

This is my code so far:

MC1.addEventListener(MouseEvent.MOUSE\_UP, handleMouseUp);  
MC2.addEventListener(MouseEvent.MOUSE\_UP, handleMouseUp);

function handleMouseUp(event:MouseEvent):void {  
changePage();  
}

function changePage(event:MouseEvent, SOMETHING):void {  
Content.REMOVE\_ALREADY\_LOADED\_CONTENT  
Content.addChild(new SOMETHING());  
}
