AS3 center movieclip to stage problems. Please HELP!

Im sure theres an easy solution to my problem so here it goes.

Im making a document class that attaches 2 moviclips using the addchild method. One movieclip (bgGradient) needs to be stretched 100% stage width/height and the other movieclip (bgCenter) need to be aligned/stretched 20px from top,left,bottom,top.

Here is the class and the errors its producing:

 
"1120: Access of undefined property bgGradient."
"1120: Access of undefined property bgCenter."


[COLOR=blue]package[/COLOR] classes {
 
    [COLOR=dimgray]// List of imported classes[/COLOR]
    [COLOR=blue]import flash.display.Stage[/COLOR];
    [COLOR=blue]import flash.display.Sprite[/COLOR];
    [COLOR=blue]import flash.display.MovieClip[/COLOR];
    [COLOR=blue]import flash.display.StageAlign[/COLOR];
    [COLOR=blue]import flash.display.StageScaleMode[/COLOR];
    [COLOR=blue]import flash.events.Event[/COLOR];
    [COLOR=blue]import flash.events.MouseEvent[/COLOR];
 
    [COLOR=blue]public class[/COLOR] WebSite [COLOR=blue]extends Sprite[/COLOR] {
 
    [COLOR=blue]public function[/COLOR] WebSite() {
        init();
    }
 
    [COLOR=blue]private[/COLOR] function init():[COLOR=blue]void [/COLOR]{
        initStage();
        addBackgrounds();
        alignBackgrounds();
    }
 
    [COLOR=dimgray]// Set the properties of our stage[/COLOR]
    [COLOR=blue]private function[/COLOR] initStage():void {
        [COLOR=blue]stage.frameRate[/COLOR] = 30;
        [COLOR=blue]stage.showDefaultContextMenu[/COLOR] = [COLOR=blue]false[/COLOR];
        [COLOR=blue]stage.scaleMode[/COLOR] = [COLOR=blue]StageScaleMode.NO_SCALE[/COLOR];
        [COLOR=blue]stage.align[/COLOR] = [COLOR=blue]StageAlign.TOP_LEFT[/COLOR];
        [COLOR=blue]stage.addEventListener[/COLOR]([COLOR=blue]Event.RESIZE,[/COLOR] resizeHandler);
    }
 
    [COLOR=dimgray]// Functions to hit when the stage is resized[/COLOR]
    [COLOR=blue]private function[/COLOR] resizeHandler([COLOR=blue]event[/COLOR]:[COLOR=blue]Event[/COLOR]):[COLOR=blue]void[/COLOR] {
        alignBackgrounds();
    }
 
    [COLOR=dimgray]// Creates the backgrounds[/COLOR]
    [COLOR=blue]private function[/COLOR] addBackgrounds():[COLOR=blue]void[/COLOR] {
 
        [COLOR=blue]var [/COLOR]bgGradient = [COLOR=blue]new[/COLOR] mainBackground;
        [COLOR=blue]addChild[/COLOR](bgGradient);
 
        [COLOR=blue]var[/COLOR] bgCenter = [COLOR=blue]new[/COLOR] mainContent;
        [COLOR=blue]addChild[/COLOR](bgCenter);
 
    }
 
    [COLOR=dimgray]// Align the backgrounds[/COLOR]
    [COLOR=blue]private function[/COLOR] alignBackgrounds():[COLOR=blue]void [/COLOR]{
        bgGradient.[COLOR=blue]x[/COLOR] = 0;
        bgGradient.[COLOR=blue]y[/COLOR] = 0;
        bgGradient.[COLOR=blue]width[/COLOR] = [COLOR=blue]stage.stageWidth[/COLOR];
        bgGradient.[COLOR=blue]height[/COLOR] = [COLOR=blue]stage.stageHeight[/COLOR];
 
        bgCenter.[COLOR=blue]x [/COLOR]= 20;
        bgCenter.[COLOR=blue]y[/COLOR] = 20;
        bgCenter.[COLOR=blue]width[/COLOR] = [COLOR=blue]stage.stageWidth[/COLOR] - 40;
        bgCenter.[COLOR=blue]height[/COLOR] = [COLOR=blue]stage.stageHeight[/COLOR] - 40;
    }
  }
}

Thanks :thumb2: