I’m trying everything to get this box to scale with rounded corners not getting stretched. I can’t figure it out. The box is about 167 x 35 and this is my code, sorry if it’s a lot
import flash.geom.Rectangle;
import mx.transitions.Tween;
import mx.transitions.easing.*;
onEnterFrame = function():Void{
space = 2;
btn2._x = (btn1._x + btn1._width + space);
btn3._x = (btn1._x + btn1._width + btn2._width + (2 * space));
}
btn1.scale9Grid = new Rectangle(6, 10, 5, 5);
function enlarge(target:MovieClip):Void {
var twUpY:Tween = new Tween(target, "_yscale", Elastic.easeOut, target._yscale, 360, 40, false);
var twUpX:Tween = new Tween(target, "_xscale", Elastic.easeOut, target._xscale, 160, 40, false);
target.mytoggle = true;
var oListener:Object = new Object();
oListener.onMotionFinished = function():Void{
if (target.mytoggle == true){
target.play();
}
}
twUpY.addListener(oListener);
}
function shrink(target:MovieClip):Void{
target.mytoggle = false;
target.gotoAndStop(1);
var twDownY:Tween = new Tween(target, "_yscale", Elastic.easeOut, target._yscale, 100, 40, false);
var twDownX:Tween = new Tween(target, "_xscale", Elastic.easeOut, target._xscale, 100, 40, false);
}
btn1.onRollOver = function(){
enlarge(btn1);
}
btn1.onRollOut = function(){
shrink(btn1);
}
btn2.onRollOver = function(){
enlarge(btn2);
}
btn2.onRollOut = function(){
shrink(btn2);
}
btn3.onRollOver = function(){
enlarge(btn3);
}
btn3.onRollOut = function(){
shrink(btn3);
}
I tried changing all the dimensions of the rectangle, that didn’t help at all, it’s like it doesn’t even acknowledge it’s there…