# Simple Button Problem

**URL:** https://forum.kirupa.com/t/simple-button-problem/231396
**Category:** Uncategorized
**Created:** [July 4, 2007, 11:48am UTC](https://forum.kirupa.com/t/simple-button-problem/231396 "2007-07-04T11:48:26Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Zahmet](https://avatars.discourse-cdn.com/v4/letter/z/da6949/32.png) [@Zahmet](https://forum.kirupa.com/u/Zahmet)
#### Post date: [July 4, 2007, 11:48am UTC](https://forum.kirupa.com/t/simple-button-problem/231396/1 "2007-07-04T11:48:26Z")

</div>

Hi, Im very new to flash and actionscript and I need some help with a simple problem.

I have a very simple flash atm. It had a background just a bunch of lines squares et.c. and I have a button. Now Ive rightclicked and checked its properties, and it is a button, it has a name, and I have checked the checkbox for “Export for ActionScript” (dont have english version but should be called something similar).

I just want something to happen when I click the button, I dont want to change the “Over”,“Down” or “Hit” thing, I want a actionscript to just type out a word or later what I really want is that it should jump to the next frame. So what ive found was that I could use eventlisterners to make this happen, now Im familiar with Java programming so there are alot of similaries.

myButton.addEventListener(  
MouseEvent.MOUSE\_UP,  
function(evt:MouseEvent):void {  
trace(“I’ve been clicked!”);  
}  
);

Now I get an error 1120: Access of undefined property myButton, at this point I dont know what do I have to add? Do I need to add some variable for my button? do I have to import some things?

Ive been searching the internet for some time now and can’t find any tips for a total beginer. I tried to add

import flash.display.Sprite;  
var myButton:SimpleButton = new SimpleButton();

but Im not sure if this is the right way, it feels like this would make a new button called myButton that I could then define in diffrent ways, but I want to use the button that I have already made in Flash, so how do I make that connection?

Thanks for your help.
