PDA

View Full Version : Easing trouble whats wrong ?



argentik
October 12th, 2005, 11:06 AM
hi all...
i dont understand why the easing effect doesnt work on my movieclip_mc ? I see so much fantastic effects we can do but tutorials are not really clear about easing : too much theory and not so much practical demos

I m sure something like a basis position and an end position are missing?... if u can help it would be wonderful... thanx all
A.M.(-:



movieclip_mc.onEnterFrame = function(){
Ease.bounce = function (t, b, r, m, e) { // t, b for number of bounces, r for reduction of bounce (between 0-1), m for ease method, e for ease type
if (!b) b = 1;
if (!r) r = 0;
if (!m) m = Ease.exponential;
if (!e) e = Ease.inUsing;
var es = b*2 + 1; // number of eases
b = Math.floor(t*es); // which bounce
var et = t*es - b; // ease t
var rt = 1-Math.pow(1-t, 2);
var rf = 1 - r*rt;
return ((b + 1)%2) ? r*rt + e(m, et)*rf : r*rt + e(m, 1 - et)*rf;
}
};

goto()
October 12th, 2005, 11:54 AM
MMMMMMMmmmmmm....... :crying:
That confuse me.... Why ease have to be so difficult??
I always have use this simple code
onEnterFrame = function() {
my_mc._x+=10;
my_mc._x*=.9;
}
or This one more exactly....
onEnterFrame = function() {
my_mc._x += (your_final_position-my_mc._x)/Ease_amount;
}
//its pretty :)
Sorry if I couldnt help ya with your own way....
:::::goto()::::::

argentik
October 12th, 2005, 12:28 PM
onEnterFrame = function() {
my_mc._x += (your_final_position-my_mc._x)/Ease_amount;
}


nice idea for your first formula.. can u give an example for the one i quote ?

my_mc._x +=_ _ _ _ _ _ _ _ _ _ _ _ /number ?

thanx

goto()
October 12th, 2005, 12:47 PM
hi all...
i dont understand why the easing effect doesnt work on my movieclip_mc ? I see so much fantastic effects we can do but tutorials are not really clear about easing : too much theory and not so much practical demos

I m sure something like a basis position and an end position are missing?... if u can help it would be wonderful... thanx all
A.M.(-:

Ok! your mc name is movieclip_mc, doesnt it???
its like this
onEnterFrame = function() {
movieclip_mc._x += (200-movieclip_mc._x)/10;
}
then you modify your final pos and ease amount