# Manipulating Gradient Fills via AS3

**URL:** https://forum.kirupa.com/t/manipulating-gradient-fills-via-as3/230266
**Category:** flash
**Created:** [June 24, 2007, 9:29pm UTC](https://forum.kirupa.com/t/manipulating-gradient-fills-via-as3/230266 "2007-06-24T21:29:54Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Wedge\_Man](https://avatars.discourse-cdn.com/v4/letter/w/f07891/32.png) [@Wedge\_Man](https://forum.kirupa.com/u/Wedge_Man)
#### Post date: [June 24, 2007, 9:29pm UTC](https://forum.kirupa.com/t/manipulating-gradient-fills-via-as3/230266/1 "2007-06-24T21:29:54Z")

</div>

Hey Guys,

So i have the following code…

```auto
function Light(_type:String, _xCo:Number, _yCo:Number, _w:Number, _colors:Array, _alphas:Array, _ratios:Array, _stageRef:Stage) {
            stage = _stageRef;
            
            
            movieClip = new MovieClip();
            movieClip.graphics.beginGradientFill(GradientType.RADIAL, _colors, _alphas, _ratios);
            movieClip.graphics.drawEllipse((-_w/2), (-_w/4), _w, _w/2);
            movieClip.graphics.endFill();
            movieClip.blendMode = BlendMode.SCREEN;
            movieClip.alpha = 0.6;
            movieClip.cacheAsBitmap = true;
            movieClip.mouseEnabled = false;
            xNum = ((_xCo + 1) * 50);
            yNum = ((_yCo + 1) * 25);
        }

```

Which draws a very nice oval on the screen like i want it to, however the gradient is still drawn as if it were a circle.

If i go into the Flash IDE, I can select the graident tool and then “squash” the graident so it fits the oval.

My question is how can I use actionscript to have the gradient be 1/2 as high as it is wide?

Thanks!
