# Pull a variable from a public function in class

**URL:** https://forum.kirupa.com/t/pull-a-variable-from-a-public-function-in-class/294064
**Category:** flash
**Created:** [August 7, 2009, 7:05pm UTC](https://forum.kirupa.com/t/pull-a-variable-from-a-public-function-in-class/294064 "2009-08-07T19:05:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![adlib33](https://avatars.discourse-cdn.com/v4/letter/a/73ab20/32.png) [@adlib33](https://forum.kirupa.com/u/adlib33)
#### Post date: [August 7, 2009, 7:05pm UTC](https://forum.kirupa.com/t/pull-a-variable-from-a-public-function-in-class/294064/1 "2009-08-07T19:05:14Z")

</div>

What would be the scoping to reach a variable within a external class public function FROM a function on the main timeline?

In menu.as

public function buttonClick()  
Need to reach a _starFunction_ variable(var starFunction = such and such.@fn) within an if statement within buttonClick function.

On main timeline

(menu.as declared on first frame main timeline as var menuH:Menu = new Menu()😉

In function aboutUs()  
**here is where I need to use that variable for an if statement**

??? The many variations of —trace(this.parent.menuH.starFunction);— doesn’t work. Is it possible?
