error while converting the code from flex 3 to flex 4.6

package test {
 
	import mx.core.UIComponent;
	import flash.filters.DropShadowFilter;
 
	public class GradientRectangle extends UIComponent	{
 
			import flash.display.Graphics;
			import flash.geom.Rectangle;
			import mx.graphics.GradientEntry;
			import mx.graphics.LinearGradient;
 
			protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
			   super.updateDisplayList(unscaledWidth,unscaledHeight);
				var w:Number = unscaledWidth;
				var h:Number = unscaledHeight;

				var backgroundFillColor:Number;
				var backgroundFillColor2:Number;				
 
				var fill:LinearGradient = new LinearGradient();
 
				var g:Graphics = graphics;
				g.clear();				
 
				switch (name) {
					case "upSkin":
						backgroundFillColor = 0x808060;
						backgroundFillColor2 = 0xcccc99;
						break;
					case "overSkin":
						backgroundFillColor = 0x808060;
						backgroundFillColor2 = 0xcccc99;
						break;
					case "downSkin":
						backgroundFillColor = 0x808060;
						backgroundFillColor2 = 0xcccc99;
						color: 0xFF0000;
						break;
					case "disabledSkin":
						backgroundFillColor = 0x808060;
						backgroundFillColor2 = 0xcccc99;
						break;
				}

				var g1:GradientEntry = new GradientEntry(backgroundFillColor,.10,100);
				var g2:GradientEntry = new GradientEntry(backgroundFillColor2,.60,100);
 
				fill.entries = [g1,g2];
				fill.angle = 90;
				// fill the rectangle
				g.moveTo(0,0);
				fill.begin(g,new Rectangle(0,0,w,h));
				g.lineTo(w,0);
				g.lineTo(w,h);
				g.lineTo(0,h);
				g.lineTo(0,0);
				fill.end(g);
				// if we're not showing the down skin, show the shadow. Otherwise hide it on the "down state" to look like it's being pressed
				if(name != "downSkin") {
		                     filters = [new DropShadowFilter(4, 30,0x000000,.2)];
				}
			 }
	}
}

When i compile the above code in Flash 4.6 SDK, i get the below errors. Please suggest me to resolve these:

  1. 1136: Incorrect number of arguments. Expected 3. – fill.begin(g,new Rectangle(0,0,w,h));
  2. Access of undefined property color
  3. Type was not found or was not a compile-time constant: GradientEntry
  4. Access of undefined property fill
  5. Access of undefined property g
  6. Type was not found or was not a compile-time constant: DropShadowFilter

Any help would be great!

Start with the first error and work from there. Often fixing the first can address many if not all of the others.

So: 1136: Incorrect number of arguments. Simple enough. Looking at the docs, fill does in fact need 3 and you’ve only given it two.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/graphics/LinearGradient.html#begin()

Good place to start but just sneaking a little further down the list, your use of color does seem off. Typo? Looks like you need to rip it out or fix that too.

Its not too hard to figure some of this stuff out just by reading the error message and seeing where its pointing to.