# ActionScript Classes Problem

**URL:** https://forum.kirupa.com/t/actionscript-classes-problem/324057
**Category:** flash
**Created:** [July 30, 2011, 8:37pm UTC](https://forum.kirupa.com/t/actionscript-classes-problem/324057 "2011-07-30T20:37:47Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mlundager](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@mlundager](https://forum.kirupa.com/u/mlundager)
#### Post date: [July 30, 2011, 8:37pm UTC](https://forum.kirupa.com/t/actionscript-classes-problem/324057/1 "2011-07-30T20:37:47Z")

</div>

Okay so i created a button on the stage and made it a movie clip and called it’s instance name “play\_btn” then i made a document class “main.as” and a second class “play button.as”

so what i want to do but can’t figure out how is to access the instance name in the play button.as file like this…

public class login\_page extends MovieClip {

```
	public function login_page() {
               
              play_btn.addEventListener(MouseEvent.MOUSE_DOWN, onPlayDown);

	}
           
           public function onPlayDown(evt:MouseEvent):void {

             trace("Test");

           }

}

```

and then i want to call the function in the main.as… but the general problem is that i want to access the instance name “play\_btn” in the “playbutton.as” file…

Sorry for my bad english hope someone can help me

Thanks:)
