# \[Flash8\] Problems with undefined properties in class

**URL:** <https://forum.kirupa.com/t/flash8-problems-with-undefined-properties-in-class/208440>\
**Category:** flash\
**Created:** [November 28, 2006, 7:51pm UTC](https://forum.kirupa.com/t/flash8-problems-with-undefined-properties-in-class/208440 "2006-11-28T19:51:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WoogyChuck](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/woogychuck/32/3033_2.png) [@WoogyChuck](https://forum.kirupa.com/u/WoogyChuck)\
**Post date:** [November 28, 2006, 7:51pm UTC](https://forum.kirupa.com/t/flash8-problems-with-undefined-properties-in-class/208440/1 "2006-11-28T19:51:56Z")

</div>

So I’ve got a class for a custom button I’m building. I’ve declared a view variables, but they’re getting lost. If I trace them in the OnLoad function they’re fine, but are undefined when accessed by another function in the same class. Any ideas?

This is my code:

```auto
 
class MenuButton extends MovieClip {
 [Inspectable(type="String", name="Link Text")]
  public var LinkText:String;
 [Inspectable(type="String", name="Link URL")]
  public var LinkURL:String;
 [Inspectable(enumeration="_self,_blank", defaultValue="_self", name="Link Target")]
  public var LinkTarget:String;
 
 private var HitArea:MovieClip;
 private var ButtonText:TextField;
 
 public function onLoad():Void {
  HitArea = this.HitArea;
  ButtonText = this.ButtonText;
  ButtonText.text = LinkText;
  HitArea.onMouseDown = GoLink;
  trace(LinkURL + ": " + LinkTarget); //Works Here
 }
 
 public function GoLink() {
  trace(LinkURL + ": " + LinkTarget); //Undefined Here
  getURL(LinkURL, LinkTarget);
 }
}

```
