# Please help...I am going mad : (

**URL:** <https://forum.kirupa.com/t/please-help-i-am-going-mad/321359>\
**Category:** flash\
**Created:** [April 18, 2011, 7:25am UTC](https://forum.kirupa.com/t/please-help-i-am-going-mad/321359 "2011-04-18T07:25:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![embarker](https://avatars.discourse-cdn.com/v4/letter/e/58956e/32.png) [@embarker](https://forum.kirupa.com/u/embarker)\
**Post date:** [April 18, 2011, 7:25am UTC](https://forum.kirupa.com/t/please-help-i-am-going-mad/321359/1 "2011-04-18T07:25:26Z")

</div>

Here is this class i have written.

package  
{  
import flash.events.Event;

```
public class Radius
{
    public var theRadius:Number;
    private var sideX:Number;
    private var sideY:Number;
    private var obj1:Object;
    private var obj2:Object;

    public function Radius(firstObject:Object,secondObject:Object,whoListens)
    {
        // constructor code
        whoListens.addEventListener(Event.ENTER_FRAME, mainloop);
        this.obj1 = firstObject;
        this.obj2 = secondObject;
    }

    public function mainloop(e:Event)
    {
        sideX = Math.abs(obj1.x - obj2.x);
        sideY = Math.abs(obj1.y - obj2.y);
        theRadius = Math.sqrt(sideX * sideX + sideY * sideY);
        //trace(theRadius);

    }

}

```

}

Now outside the class, I do this:

var radius1 = new Radius(someObject1,someObject2,stage);

Okay, now that I have one…  
I want to see what the radius is…so…

trace(radius1.theRadius);

And we get…NaN…

Oh god, why?  
I have been starring at it too long.:sen:
