Method in a class file that refers to itself - the this keyword is not working

package  
{    
    import flash.display.MovieClip;
    import flash.display.Graphics;
    
    public class Rail extends MovieClip 
    {    
        public var lineStyleColor:uint = 0x000000;
        public var fillColor:uint = 0x323232;
        
        private var railNumber:Number =5;
        private var spacingRailCom:Number = 500;

        public function Rail(railWidth:Number = 501, railHeight:Number = 10):void 
        {
            
            this.graphics.lineStyle(1, lineStyleColor);
            this.graphics.beginFill(fillColor);
            this.graphics.drawRect(0, 0, railWidth, railHeight);
            this.graphics.endFill();

            addToStage();
        }
       
        public function addToStage():void
        {
            for (var j:int = 0; j <= railNumber ; j++) 
                {    
                        var rail:Rail;
                        rail = new Rail;
                        
                        rail.x = j * ( spacingRailCom );
                        rail.y = 0;        
                                
                }
        }
        
        
        
    }
    
}

this is a simple Rail class, what I am trying to do is take the for loop out of the timeline and build into the Rail class itself. How do I refer to the Rail class itself within the method? If I am doing this the wrong way please let me know! Would it be better if I created another class, say a “RailSpacing” class and build the for loop into the contructor into that? Thanks

Also, if I wanted to add depth to the rail(textures or something else to make it look real) and still be able to change the color without transforming the entire rail instance, what could I do ActionScript wise. I have come to the conclusion the only way to do this is creating a multilayered movieclip and target the base object and not the highlight/ shading layer.

Also, if I created a nice graphic/movieclip and exported it for ActioSncript, how can I find the class file and add too it? Is this even possible? Is it possible to draw something that is detailed and export it and then add some methods?

thanks, Kyle