# The scope of this

**URL:** https://forum.kirupa.com/t/the-scope-of-this/242779
**Category:** Uncategorized
**Created:** [October 30, 2007, 11:22am UTC](https://forum.kirupa.com/t/the-scope-of-this/242779 "2007-10-30T11:22:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![drose429](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/drose429/32/202_2.png) [@drose429](https://forum.kirupa.com/u/drose429)
#### Post date: [October 30, 2007, 11:22am UTC](https://forum.kirupa.com/t/the-scope-of-this/242779/1 "2007-10-30T11:22:07Z")

</div>

Hi  
I am just trying to understand the scope of [COLOR=“Blue”]this[/COLOR] in AS3 for example in AS2

> basicM\_btn.onRelease = function() {  
> this.\_visible = false;  
> }

Would hvae made the button invisible

In AS3 I was expecting to write the same thing as this

> function clickHandler(event:MouseEvent):void {

this.visible = false;

}

menuA\_btn.addEventListener(MouseEvent.CLICK, clickHandler);

However this sets all of the content on the stage to visible = false

Is there a difference in the way that [COLOR=“blue”]this [/COLOR]works in AS3

Thanks for your help
