# Newbie AS 3 Question (Capturing Menu Click/How to call back from class event listene)

**URL:** <https://forum.kirupa.com/t/newbie-as-3-question-capturing-menu-click-how-to-call-back-from-class-event-listene/235166>\
**Category:** flash\
**Created:** [August 8, 2007, 11:42pm UTC](https://forum.kirupa.com/t/newbie-as-3-question-capturing-menu-click-how-to-call-back-from-class-event-listene/235166 "2007-08-08T23:42:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mwiley63](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@mwiley63](https://forum.kirupa.com/u/mwiley63)\
**Post date:** [August 8, 2007, 11:42pm UTC](https://forum.kirupa.com/t/newbie-as-3-question-capturing-menu-click-how-to-call-back-from-class-event-listene/235166/1 "2007-08-08T23:42:50Z")

</div>

Hello,

I have recently started learning actionscript 3, and I think this is just some concept I am not understanding.

I found a class for a menu that I am using, basically I want to attach a Movie Clip to the stage when a menu button is hit, but I am stuck on how to do this. Basically I have this in my main timeline:

import menuexample.BasicMenu;  
import movieClipTest.movieClipTest;  
var myMenu:BasicMenu = new BasicMenu();  
myMenu.init();  
myMenu.x = 50;  
myMenu.y = 100;  
addChild(myMenu);

var myClip:movieClipTest = new movieClipTest();  
myClip.init();

// now how do I add it to the stage when a button is hit in the menu?

I have this in my BasicMenu class:

private function displayMessage(event:MouseEvent):void {

```
        // Output the name of the clicked button.
        trace(event.currentTarget.name);
    }

```

Which traces the text (which is set to the button name) to the output window.

Can I do any kind of call back function? I know AS3 is trying to get away from this.

Thanks in advandce
