Tutorial details: You'll see how the function work and how to modify it to do your own...
Written by: Xavier MARTIN | frnc.net/doc
Time: ??
Difficulty Level: Advanced
Requirements: Flash MX
Topics Covered: Prototype, inherit, object, ...
Assumed knowledge: Variables, Paths, Objects, Methods, ...
Download FLA

I've created this function because I haven't found any which let me apply MULTIPLE EFFECT on the SAME OBJECT at the SAME TIME!!
So I've developped this function using some tricks... you'll see that it's easy to make your own with the base I'll give you. Don't forget that the code you'll do MUST be at the begining of your animation (1rst frame, begining of the code).


/*EASING **********************************************************************/
function ease (objet, targetX, targetY, speed) {
        /*If the array isn't exist, I made it.
        the first field get the object's name, the second the ID of the setinterval (look on flash help if you don't see what I'm talking about).
        In that case even if the object has been deleted, I'll be able to delete the variable, because not hold by the object itself.
        (In fact, I make a copy of the var hold by the object...).
        Do you see why I do a copy. Because if I delete the object, the setinterval always run, and I couldn't delete the setinterval
        (with clearInterval) because the ID as been lost.
        If you want more (clearly??) info mail me... ;)*/

        if(!easingArray) {
                easingArray = [[],[]];
        // Set found to false and look if the object exist in the array with the for instruction.
        var found = false;
        for(i=0; i<=easingArray[0].length; i++) {
                /* If my object is found then found is set to true and I look if the setinterval ID (in the array) equal the one hold by the object itself.
                Why? Because if the ID is different, that say that the object has been deleted or that you have put the SAME EFFECT MULTIPLE TIME ON THE SAME OBJECT.
                No use. So I have to deleted the old effect. That's why I do a clearInterval on the old one (the one in the array) and put the new one in the array.
                Maybe I'm not clear (but I'm not english...h?h?h?) so mail me if you want more info...*/

                if(easingArray[0][i] == objet) {
                        found = true;
                        if(easingArray[1][i] != objet._easing) {
                                easingArray[1][i] = objet._easing;
                        /*Here is the code of the function (effect). Here it's an easing effect*/
                        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;
                        //Don't forget to delete the ID of the setinterval
                        if( (objet._x == targetX) && (objet._y == targetY) ) {
        /* I've read all the array and haven't found the object.
        So I put its path and name on the array and the setinterval ID too.*/

        if (found == false) {
                var long = easingArray[0].length
                easingArray[0][long] = objet;
                easingArray[1][long]= objet._easing;

/*Here I define a new method for the MovieClip class. In that case this function could be call by all the MC instance, of your animation*/
Movieclip.prototype.easing = function (targetX, targetY, speed) {
        // a security... In that case I'm sure that the effect isn't apply 2 times on the same object.
        // Call the function which do the effect, with params (here I repeat it all the 40ms).
        this._easing = setinterval(ease, 40, this, targetX, targetY, speed);

Ok, but now I supose you want to make your own?
That's really simple. You have to change some piece of the code and all will be ok!
First change the function name, the array's name, and then the method's name. It look like this:

/* FonctionPerso **********************************************************************/
function PERSOFONCTION (objet, yourParams) {
        if(!PERSOArray) {
                PERSOArray = [[],[]];
        var found = false;
        for(i=0; i<=PERSOArray[0].length; i++) {
                if(PERSOArray[0][i] == objet) {
                        found = true;
                        if(PERSOArray[1][i] != objet._perso) {
                                PERSOArray[1][i] = objet._perso;
                        ... your code for your effect ...
        if (found == false) {
                var long = PERSOArray[0].length
                PERSOArray[0][long] = objet;
                PERSOArray[1][long]= objet._perso;

Movieclip.prototype.PERSOMETHODE = function (param?tres) {
        this._perso = setinterval(PERSOFONCTION, param?tres);

See how it works?! It's always the same thing... Mail me if you want more info or if you have pb.

Here is another function to resize MC. You can see the difference between this one and the easing one.

/** RESIZE *******************************************************************/
function resizeMC (objet, X, Y, speed) {
        if(!resizeMCArray) {
                resizeMCArray = [[],[]];
        var found = false;
        for(i=0; i<=resizeMCArray[0].length; i++) {
                if(resizeMCArray[0][i] == objet) {
                        found = true;
                        if(resizeMCArray[1][i] != objet._resize) {
                                resizeMCArray[1][i] = objet._resize;
                        // Donc ici mon effet de redimensionnement.
                        if( (Math.ceil(objet._width) < ( Math.ceil(X - 1) ) ) || (Math.ceil(objet._width) > ( Math.ceil(X + 1) ) ) ){
                                objet._width += (X - objet._width)/speed;
                        } else {
                                objet._width = X;
                        if( (Math.ceil(objet._height) < ( Math.ceil(Y - 1) ) ) || (Math.ceil(objet._height) > ( Math.ceil(Y + 1) ) ) ){
                                objet._height += (Y - objet._height)/speed;
                        } else {
                                objet._height = Y;
                        if( (objet._width == X) && (objet._height == Y) ) {
        if (found == false) {
                var long = resizeMCArray[0].length
                resizeMCArray[0][long] = objet;
                resizeMCArray[1][long]= objet._resize;

Movieclip.prototype.resize = function (targetX, targetY, speed) {
        this._resize = setinterval(resizeMC, 40, this, targetX, targetY, speed);


That's all!
Don't forget that this function (when ok) can be put "as is" on your code. Take your time to really see how it works then you'll able to make your own. Mail me your creation plz!!!

Good Flashing!