A$&*%HFG SPRING effect!?! How!!??
Grrrrrr. This is driving me crazy. I've been searching high and low for a tutorial on how to achieve this awesome spring effect on the buttons/clips when you resize the screen.
http://www.refune.com/index_main.html
Does anyone have any idea how to do this?? It's the last bit I need to finish my project!!! Grrr. Thanks :yikes:
Maybe you can adapt this to what you are trying to do...
Code:
import mx.transitions.Tween;
import mx.transitions.easing.Bounce;
// set stage scaling
Stage.scaleMode = "noScale";
Stage.align = "TL";
// tween variables
var tweenX:Tween;
var tweenY:Tween;
// resize event
Stage.addListener(this);
function onResize() {
// stop any tweens if playing
tweenX.stop();
tweenY.stop();
// set up new tweens to move to center of stage
tweenX = new Tween(mcRec, "_x", Bounce.easeOut, mcRec._x, Stage.width * mcRec.perX, 20, false);
tweenY = new Tween(mcRec, "_y", Bounce.easeOut, mcRec._y, Stage.height * mcRec.perY, 20, false);
}
// immediately fit to current size
onResize();
mcRec.perX = mcRec._x / Stage.width;
mcRec.perY = mcRec._y / Stage.height;