# Button functions: AS2 to AS3

**URL:** <https://forum.kirupa.com/t/button-functions-as2-to-as3/316944>\
**Category:** flash\
**Created:** [December 6, 2010, 4:09pm UTC](https://forum.kirupa.com/t/button-functions-as2-to-as3/316944 "2010-12-06T16:09:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cantaloupe](https://avatars.discourse-cdn.com/v4/letter/c/90db22/32.png) [@cantaloupe](https://forum.kirupa.com/u/cantaloupe)\
**Post date:** [December 6, 2010, 4:09pm UTC](https://forum.kirupa.com/t/button-functions-as2-to-as3/316944/1 "2010-12-06T16:09:38Z")

</div>

Hi, I have a simple button function on my AS2 game that calls up an ‘instructions’ mc from the library when clicked and places it at the centre of the stage.

I’m having trouble getting my head round converting it to AS3… if anyone can help I’d be really grateful!

```auto
instructions_btn.onRelease=instructions_btn.onReleaseOutside=function () {	
	sClick.start(0,1);
	this.enabled=false;
	playgame_btn.enabled=false;
	var instructions:MovieClip=myRoot.attachMovie("instructions","instructions",myRoot.getNextHighestDepth());
	instructions._x=(Stage.width-instructions._width)/2;
	instructions._y=(Stage.height-instructions._height)/2;
}

```
