# Displaying my return value query

**URL:** <https://forum.kirupa.com/t/displaying-my-return-value-query/302105>\
**Category:** flash\
**Created:** [December 21, 2009, 10:32pm UTC](https://forum.kirupa.com/t/displaying-my-return-value-query/302105 "2009-12-21T22:32:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nvidia](https://avatars.discourse-cdn.com/v4/letter/n/bc8723/32.png) [@nvidia](https://forum.kirupa.com/u/nvidia)\
**Post date:** [December 21, 2009, 10:32pm UTC](https://forum.kirupa.com/t/displaying-my-return-value-query/302105/1 "2009-12-21T22:32:56Z")

</div>

Hi,  
i have made a very simple application where i have created a ball which follows the mouse. However, seeing that i am new to this, what is the easiest/common way for me to be able to display the value of my “distance” variable without having to make my velFriction of type void? because if i make it void i can trace the distance value between the ball and the mouse but the ball moviclip stays still.

```auto

package  
{
 
 /**
  * Zenos.as is meant to show how you can demonstrate friction using the Zenos Paradox theory
  * @author Luong Vuong
  * Date created: 21/12/2009
  * Last modified: 21/12/2009
  */
 
 import flash.display.MovieClip;
 import flash.display.Sprite;
 import flash.events.Event;
 
 public class Zenos extends Sprite 
 {
  private var ball:MovieClip;
  
  public function Zenos() :void 
  {
   ball = new Ball();
   ball.x = ball.y = 100;
    
   construct();
   
    
  }
  
    
  // Add listeners and add UI to display list
  public function construct() :void
  {
   addChild(ball);
   addEventListener(Event.ENTER_FRAME, onLoop, false, 0, true);
     
    
  }
  
  public function onLoop(evt:Event) :void
  {
   ball.x += velFriction(ball.x, mouseX, 5);
   ball.y += velFriction(ball.y, mouseY, 5);
  }
  
  
  public function velFriction(orig:Number, dest:Number, coef:Number) :Number
  {  
   var distance:Number = (dest - orig) / coef;
     return distance ;
    
   
  }
 }
 
}
 

```

Thanks  
This is taken from Learning Actionscript:A Beginners Guide pg. 128
