Oh, I believe you are talking about easing. Stick these two prototypes in a frame on the main stage:
MovieClip.prototype.easeToObj = function (obj, ease) {
this.onEnterFrame = function () {
this._x += (obj._x-this._x)/ease;
this._y += (obj._y-this._y)/ease;
};
};
MovieClip.prototype.easeToLoc = function (x, y, ease) {
this.onEnterFrame = function () {
this._x += (x-this._x)/ease;
this._y += (y-this._y)/ease;
};
};
Now, how these work…since these functions are both MovieClip prototypes, they only work with movieclips for the time being.
The way these functions work, is depending on which one you call, you basically tell it where to go. For example, with easeToObj, the first parameter is an object, which can be anything (movieclip, button, etc). The second parameter is the ease scale. You want to keep it at a value greater than or equal to 2. Setting it at one will basically move it there automatically. The higher the ease value, the slower it takes for the object that calls that function to get to where it’s going.
Now the second function I have there works the same, only you give it a position to go to in (x, y) coordinates. The ease parameter remains the same.
Well, I think the reason is that since this is a help forum, anybody could post a question anytime; yet that is a contradiction which they fail to notice. If a person wants to ask a question, he/she completely ignores the fact that others are also seeking help and that some may have already asked the same question before.
It’s also a psychological thing, if one seeks help for his or her own benefit, there is little chance that person has any regard to anyone but himself for the moment. But if you want people to search before posting, you should tell them when they sign up or whatever.
I did search the forums howeve, I am new to actionscript and flash mx, and whilst I know what I am trying to do, the terms I use to describe it, are not always those that the particular posts use as their references.
My initial question really was how do I pass a value (the endx position) to a movieclip when a button is pressed.
I have since worked it by calling a function inside the onRelease and the function has the value defined.
It isn’t easy to find the relevant post when you really don’t know what you are doing. I am trying to learn, will hopefully get better and will spend longer searching next time.
Is there anyway to receive all messages from all posts by email, as reading all of these will help me learn more.
Flash Deano: It makes sense that you didn’t know what to search for, we are just messing with your head because you posted the question and waited for an answer when really the answer was right in front of you in the tutorials at kirupa.com
Is there anyway to receive all messages from all posts by email, as reading all of these will help me learn more.
I am not sure I understand what you mean there? Can you explain?