Swish Resizer
The Flash
The Script
While this could most definitely be trimmed down, as a far as the amount of code, I was very tired of looking at it
function DrawBox(sName,s,fc,bc,w,h,x,y,dpth,opc){
ref= this.createEmptyMovieClip(sName,dpth);
ref.lineStyle(0,0xFFFFFF,0);
ref.moveTo(x,y);
ref.lineStyle(0,bc,10);
ref.beginFill(fc,opc);
ref.lineTo(x+w,y);
ref.lineTo(x+w,y+h);
ref.lineTo(x,y+h);
ref.lineTo(x,y);
ref.endfill();
ref.onEnterFrame = function(){
this._X -= 250-(this._width/2);
this._X *= 0.4;
this._X += 250-(this._width/2);
this._Y -= 250-(this._height/2);
this._Y *= 0.4;
this._Y += 250-(this._height/2);
}
}
function setStage(){
DrawBox("shadowBox",0,0x000000,0x000000,boxW,boxH,0.5,0.5,1,50);
DrawBox("whiteBox",1,0xffffff,0x000000,boxW-2,boxH-2,0,0,2,100);
DrawBox("contentBox",1,0xA24B30,0x000000,boxW-8,boxH-8,0,0,3,100);
}
onLoad(){
movieH = 500;
movieW = 500;
movieXC = movieW/2;
movieYC = movieH/2;
boxH = 100;
boxW = 300;
boxX = movieXC-(boxW/2);
boxY = movieYC-(boxH/2);
setStage();
nWidth = 300;
nHeight = 100;
steps=10;
}
onEnterFrame() {
if (shadowBox._height < nHeight){
shadowBox._height+=(nHeight/steps);
contentBox._height+=(nHeight/steps);
whiteBox._height+=(nHeight/steps);
}
if (shadowBox._height > nHeight){
shadowBox._height-=(nHeight/steps);
contentBox._height-=(nHeight/steps);
whiteBox._height-=(nHeight/steps);
}
if (shadowBox._width < nWidth){
shadowBox._width+=(nWidth/steps);
contentBox._width+=(nWidth/steps);
whiteBox._width+=(nWidth/steps);
}
if (shadowBox._width > nWidth){
shadowBox._width-=(nWidth/steps);
contentBox._width-=(nWidth/steps);
whiteBox._width-=(nWidth/steps);
}
_root.ONE._X = shadowBox._X;
_root.ONE._Y = shadowBox._Y-15;
_root.TWO._X = shadowBox._X+50;
_root.TWO._Y = shadowBox._Y-15;
_root.THREE._X = shadowBox._X+100;
_root.THREE._Y = shadowBox._Y-15;
}
OnLoad(){
n=5;
ref = this.createEmptyMovieClip("ONE",n++);
ref.createTextField("ONE",n++, 0,0,40,18);
ref.ONE.text = this.ONE._name;
ref.onRelease = function(){
_root.nWidth = 300;
_root.nHeight = 100;
};
ref = this.createEmptyMovieClip("TWO",n++);
ref.createTextField("TWO",n++, 0,0,40,18);
ref.TWO.text = this.TWO._name;
ref.onRelease = function(){
_root.nWidth = 150;
_root.nHeight = 100; ;
};
ref = this.createEmptyMovieClip("THREE",n++);
ref.createTextField("THREE",n++, 0,0,50,18);
ref.THREE.text = this.THREE._name;
ref.onRelease = function(){
_root.nWidth = 400;
_root.nHeight = 250; ;
}
}
onFrame(1){stop();}