# Creating an Event Listener

**URL:** <https://forum.kirupa.com/t/creating-an-event-listener/330633>\
**Category:** flash\
**Created:** [February 20, 2013, 4:23pm UTC](https://forum.kirupa.com/t/creating-an-event-listener/330633 "2013-02-20T16:23:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sporkula](https://avatars.discourse-cdn.com/v4/letter/s/ed8c4c/32.png) [@sporkula](https://forum.kirupa.com/u/sporkula)\
**Post date:** [February 20, 2013, 4:23pm UTC](https://forum.kirupa.com/t/creating-an-event-listener/330633/1 "2013-02-20T16:23:48Z")

</div>

I’m trying to learn how to create an event listener with ActionScript 2 in Flash CS6. I took over some Flash projects at work and know only basic code, and have nobody to help with the more complex stuff! I’ve looked at quite a few tutorials and forum posts but can’t figure out how to use the other code I’ve seen in my own project. I’ll try to describe as best as I can.

My main file has two movie clips called “content\_mc” and “sideNav\_mc” that I am loading and swapping swfs into. In the swf loaded into “content\_mc” I have six buttons. When one of these buttons is clicked, it needs to load “menu.swf” into “sideNav\_mc” and then gotoAndPlay the frame that correponds with the button that was clicked. So if a user clicks “button3\_btn” then “menu.swf” will load and automatically start at frame 3.

Can anyone help me figure out what code to use for this, using the swf/instance names I provided above? Thanks!
