Kovax
December 22, 2003, 5:47pm
1
Hi all,
I am easing a bitmap from one location to another using this function:
function easeX(endX, speed)
{
this.onEnterFrame = function()
{
this._x += (endX-this._x)/speed;
}
}
However, as the bitmap nears its end location it jiggles back and forth before coming to rest. Any ideas?
Thanks.
system
December 22, 2003, 6:40pm
2
function easeX(endX, speed)
{
this.onEnterFrame = function()
{
var dx = endX - this._x;
this._x += dx/speed;
if (Math.abs(dx)<1) {
this._x = endX;
delete this.onEnterFrame;
}
}
}
pom
system
December 22, 2003, 7:59pm
3
That is a nice addition, it makes sure its actually ends up where I want it to. But the image still jiggles, I wonder if this is just a bug in Flash??
system
December 22, 2003, 8:08pm
4
If you’re messing with bitmaps in Flash, you have to set the apha to 98 or 99%. For some reason, this stops the jiggle. Also, if a bitmap is ever “faded” out, you should alpha it to 1 - 2%, not zero…
system
December 23, 2003, 3:51am
5
:q:
That didn’t work for me either. I tried placing the image into a graphic symbol, and then lowering the alpha.
system
December 23, 2003, 4:05am
6