I set up an ease array using an older code to scroll to different X/Y coordinates on my site through button clicks. However it only works if published in Flash 6. Here is the code:
/*EASING **********************************************************************/
function ease (objet, targetX, targetY, speed) {
if(!easingArray) {
easingArray = [[],[]];
}
var found = false;
for(i=0; i<=easingArray[0].length; i++) {
if(easingArray[0]* == objet) {
found = true;
if(easingArray[1]* != objet._easing) {
clearInterval(easingArray[1]*);
easingArray[1]* = objet._easing;
};
if( (Math.ceil(objet._x) < ( Math.ceil(targetX - 1) ) ) || (Math.ceil(objet._x) > ( Math.ceil(targetX + 1) ) ) ){
objet._x += (targetX - objet._x)/speed;
} else {
objet._x = targetX;
};
if( (Math.ceil(objet._y) < ( Math.ceil(targetY - 1) ) ) || (Math.ceil(objet._y) > ( Math.ceil(targetY + 1) ) ) ){
objet._y += (targetY - objet._y)/speed;
} else {
objet._y = targetY;
};
if( (objet._x == targetX) && (objet._y == targetY) ) {
clearInterval(objet._easing);
};
};
};
if (found == false) {
var long = easingArray[0].length
easingArray[0][long] = objet;
easingArray[1][long]= objet._easing;
}
};
Movieclip.prototype.easing = function (targetX, targetY, speed) {
trace(“ease”);
clearInterval(this._easing);
this._easing = setInterval(ease, 40, this, targetX, targetY, speed);
}
/*****************************************************************************/
this.directions.onRelease = function () {
desk.easing (-925, 25, 3);
}
this.home.onRelease = function () {
desk.easing (24, 0, 3);
}
this.calendar.onRelease = function () {
desk.easing (-925, -752, 3);
}
this.Press.onRelease = function () {
desk.easing (24, -782, 3);
}
this.plays.onRelease = function () {
desk.easing (-1875, 0, 3);
}
this.tickets.onRelease = function () {
desk.easing (-1875, -782, 3);
}
this.company.onRelease = function () {
desk.easing (24, -1465, 3);
}
this.contact.onRelease = function () {
desk.easing (-1875, -1465, 3);
}
this.dining.onRelease = function () {
desk.easing (-955, -1445, 3);
}
Is there an easier way to do this? “desk” is a mc.