Resize Sprite
Hi, I'm trying to create a slider which will control the radius of a sprite I've created. This is the code I have so far:
var aura:Slider = new Slider();
aura.liveDragging = false;
aura.setSize(120,20);
aura.maximum = 100;
aura.minimum = 0;
aura.snapInterval = 1;
aura.value=50;
aura.x = 335;
aura.y = 615;
addChild(aura);
var circle:Sprite = new Sprite();
var circleradius:Number = aura.value;
circle.graphics.lineStyle(3, 0x000000, 1);
circle.graphics.beginGradientFill(fillType, colors, alphas, ratios, matr, spreadMethod);
circle.graphics.drawCircle(stage.stageWidth*.5 - map.width*.5, stage.stageHeight*.5 - map.height*.5, circleradius);
addChild(circle)
This adds my slider, "aura", and the sprite, "circle", and sets the radius to the slider default value, 50.
I'm just wondering what I need to add to this in order for the sprite to change radius each time I move the slider.
I did manage to get the sprite to change size with the slider but it added a new sprite each time.
Thanks in advance,
Thomas.
|