# Getting Number Out Of A Function

**URL:** <https://forum.kirupa.com/t/getting-number-out-of-a-function/240738>\
**Category:** flash\
**Created:** [October 5, 2007, 4:02pm UTC](https://forum.kirupa.com/t/getting-number-out-of-a-function/240738 "2007-10-05T16:02:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brndn](https://avatars.discourse-cdn.com/v4/letter/b/dec6dc/32.png) [@brndn](https://forum.kirupa.com/u/brndn)\
**Post date:** [October 5, 2007, 4:02pm UTC](https://forum.kirupa.com/t/getting-number-out-of-a-function/240738/1 "2007-10-05T16:02:18Z")

</div>

Hi there  
So I have this thing here that is passing xml data to the “callGauges” function.  
with-in this function if I trace “gauge\_1\_1” I get the correct number.

What I want to do is assign that number to “public var Gauge\_1\_1:Number;”

And then use the var in the function guageLoaded.

The trace inside “guageLoaded” function is returning NAN

Im sure this should be simple but my as2 brain does not like it.

```auto
public var Gauge_1_1:Number;

///////////////////////////////////////////////
//////////////////////////////////////////////

public function callGauges(data:XMLList){
     var gauge_list:XMLList = data;
Gauge_1_1 = new Number(gauge_1_1);    
var gauge_1_1:Number = Math.floor(((Number(gauge_list))-(Number(gauge_list)))/(Number(gauge_list))*100);    
}

/////////////////////////////////////////
////////////////////////////////////////

public function guageLoaded(which:Number):void{
    trace(which);
    var thisGuage:MovieClip;
    switch(which){
        case 1:
        thisGuage = guage_1.content as MovieClip;
        thisGuage.positionNeedles(null, Gauge_1_1, Gauge_1_2, null, 0.2);
   trace("Gauge =========="+Gauge_1_1);
        break; 
    }     
}

```
