# Classes - Returning value from other function

**URL:** <https://forum.kirupa.com/t/classes-returning-value-from-other-function/295765>\
**Category:** flash\
**Created:** [September 3, 2009, 11:27pm UTC](https://forum.kirupa.com/t/classes-returning-value-from-other-function/295765 "2009-09-03T23:27:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![energy](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@energy](https://forum.kirupa.com/u/energy)\
**Post date:** [September 3, 2009, 11:27pm UTC](https://forum.kirupa.com/t/classes-returning-value-from-other-function/295765/1 "2009-09-03T23:27:42Z")

</div>

Hey Guys,

I have a question regarding classes. Small example below.

Lets say my class is like this.  
[AS]  
class MyClass  
{

```
public function Clue // this will be called externally
{
	something.addEventListener(NetStatusEvent.NET_STATUS, returnResult);
}

function returnResult(e:NetStatusEvent)
{
	return success; //Result is generated in this function When NetConnection reports Status
				//this is the result i want to return whosoever calls that function
}

```

}

[/AS]

So lets say i create an instance of this class  
[AS]  
var s = new MyClass;  
var f = s.clue();  
[/AS]  
What i want is that **clue()** should return me the value of _NetStatus_ which is generated in **returnResult()** when this function is invoked.

Now in this case var _“f”_ will become undefined because **Clue()** is not returning anything, so how can i find a way that value of _NetStatusEvent.NET\_STATUS_ (in this case) will be returned from Clue().

Although i can use ENTER FRAME EVENT to check when it has generated a status but i’m sure that there must be a better way.

Thanks in advance!
