[FMX]Just curiosity

Is the number in a function representing the speed(in case of easing) equal to a certain amount of frames?

is there more to this? Is this from another thread? If so, let me know so I can move it there :wink: otherwise I think you may need to provide more detail of what it is you’re asking exactly

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 :slight_smile:

The movie framerate is 12

Thanks in advance :slight_smile:

well yeah, your question means nothing without that function :wink:

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)

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

A tutorial of mine with motion tweens? I belive it when I see it :huh:

I found it back and it was indeed from Voetsjoeba! Sorry Pom :slight_smile:

yeah, I dont think pom learned motion tweens yet :wink:

:smiley: Title says different now :wink:

haha

(but he does learn quick!)