PDA

View Full Version : [FMX]Just curiosity



dboers
August 1st, 2004, 08:20 AM
Is the number in a function representing the speed(in case of easing) equal to a certain amount of frames?

senocular
August 1st, 2004, 08:22 AM
is there more to this? Is this from another thread? If so, let me know so I can move it there ;) otherwise I think you may need to provide more detail of what it is you're asking exactly

dboers
August 1st, 2004, 08:33 AM
No it's not from another thread, but what I mean is this

Suppose I have a a function for an easing movement like:

function moveClip (clip, ypos, speed) {
clip.onEnterFrame = function() {
endY = ypos - this._y;
this._y += endY / speed;
if (Math.abs(endY)<2) {
this._y = ypos
delete this.onEnterFrame;
}
};
};
moveClip (myMovie, 300, 8);

My question is if the 8 in the callBack is equal to a certain amout of frames.

Thanks in advance :)

dboers
August 1st, 2004, 08:35 AM
The movie framerate is 12

Thanks in advance :)

senocular
August 1st, 2004, 08:41 AM
well yeah, your question means nothing without that function ;)

8 is not frames in that instance, its a measurement of speed as the variable name indicates. Change the value of speed and the speed changes.

In terms of what it does mathmatically, speed actually represents a percentage of progression towards the target position. Each time the clip moves, it moves 1/speed percent towards the target, the idea being that each time you get closer to the desired location that percentage would get smaller and smaller and smaller which causes the easing in the movement (progressively reducing speed as the amount of movement decreases)

dboers
August 1st, 2004, 08:50 AM
I asked this because I saw an tutorial here on Kirupa with transitions between different external swf's.(I think it was from Pom) Those where made with motion tweens. But I heard a lot of times that motion tweens, making your movie quit heavy so I figured, that if I know how many frames a movement made with action script takes, that I could make the same transitions with functions.


Thanks

pom
August 2nd, 2004, 11:00 AM
A tutorial of mine with motion tweens? I belive it when I see it :huh:

dboers
August 3rd, 2004, 06:12 AM
I found it back and it was indeed from Voetsjoeba! Sorry Pom :)

senocular
August 3rd, 2004, 07:33 AM
yeah, I dont think pom learned motion tweens yet ;)

pom
August 3rd, 2004, 10:34 AM
:D Title says different now ;)

senocular
August 3rd, 2004, 10:40 AM
haha

(but he does learn quick!)