Hi
I’m trying to use the mx teen class to replicate the movement in this website:
So far I’ve got here:
http://www.detkendesign.com/detken3/test6.php
I’ve got the basic structure but am having problems with the xscale / yscale aspect and getting the tween to a new box to avoid the looping movement from above when the new box enters frame.
The AS is below - .fla attached - grateful for any input.
Thanx
d
stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;
MovieClip.prototype.tween = function(theProp:String, from:Number, to:Number, time:Number) {
_global.when = new Tween(this, theProp, Strong.easeInOut, from, to, time, true);
};
//function for button
function btn1Function() {
//first move to center in one second witih no delay
main_mc.tween("_x", -1000, 329, 1);
main_mc.tween("_y", 126, 126, 1);
// and in 2 seconds scale closer
main_mc.tween("_xscale", 60, 120, 2);
main_mc.tween("_yscale", 60, 120, 2);
_global.when.onMotionFinished = function() {
trace("ok");
};
}
//call function now
btn1Function();
//add function to button onRelease
btn1.onRelease = function() {
btn1Function();
};
btn2.onRelease = function() {
gotoAndStop("bt2");
//first move to center in one second witih no delay
main_mc.tween("_x", 280, -717, 1);
main_mc.tween("_y",126, 126, 1);
// and in 2 seconds scale closer
main_mc.tween("_xscale", 100, 120, 2);
main_mc.tween("_yscale", 100, 120, 2);
_global.when.onMotionFinished = function() {
trace("ok");
};
}
btn3.onRelease = function() {
gotoAndStop("bt3");
//first move to center in one second witih no delay
main_mc.tween("_x", 280, 329, 1);
main_mc.tween("_y", 126,-1086, 1);
// and in 2 seconds scale closer
main_mc.tween("_xscale", 100, 120, 2);
main_mc.tween("_yscale", 100, 120, 2);
_global.when.onMotionFinished = function() {
trace("ok");
};
}
btn4.onRelease = function() {
gotoAndStop("bt4");
//first move to center in one second witih no delay
main_mc.tween("_x", 280,-717, 1);
main_mc.tween("_y", 126,-1086, 1);
// and in 2 seconds scale closer
main_mc.tween("_xscale", 100, 120, 2);
main_mc.tween("_yscale", 100, 120, 2);
_global.when.onMotionFinished = function() {
trace("ok");
};
}
btn5.onRelease = function() {
gotoAndStop("bt5");
//first move to center in one second witih no delay
main_mc.tween("_x", 280,-193, 1);
main_mc.tween("_y", 126,-466, 1);
// and in 2 seconds scale closer
main_mc.tween("_xscale", 100, 120, 2);
main_mc.tween("_yscale", 100, 120, 2);
_global.when.onMotionFinished = function() {
trace("ok");
};
}