Getter function now working

I’m confused. I’m trying to use a getter function and have set it up the way I think is should work but it’s not working. would someone tell me what I’m doing wrong?
Thanks!

I get:
1170: Function does not return a value.


package  {
    
    import flash.display.MovieClip;
    
    public class Main extends MovieClip 
    {
        
        public function Main() 
        {
        
        var drager = new ScrollByDrag;
        addChild(drager);
        var theIndex = drager.getCurrentIndex();
        trace(theIndex + " = CurrentIndex");

        }
    }
}


package  {
    import flash.display.Sprite;

    public class ScrollByDrag extends Sprite
    {
    public var currentIndex:Number = 5;

    public function ScrollByDrag()
    {
       trace("test");
    }

    public function getCurrentIndex():Number
    {
        return currentIndex;
    }

    public function setCurrentIndex(theCurrentIndex):Number
    {
       currentIndex = theCurrentIndex;
    }
    
    }
}