Problem tweening MC slow movement with Tweener, even with smoothing

812 Views Asked by At

I think that Tweener is not using fractions of pixels on x,y movement, but that exactly what I need. I read about rounded parameter (default:false), that would round pixels, to reduce problems with text, but I want to slowly pan an loaded image, so I don't want to use a rounded value. My code:

var bmp = Bitmap(loader.content);
bmp.smoothing = true;
Tweener.addTween(loader, {x: 20.0, time:10, transition:"linear"});

Image smoothing works fine, but it slides choppy. It looks like moving 1 pixel at seldom frames, not some fraction of px per frame. I'm considering that flash image smoothing has to deal with fraction of pixels. I searched over stackoverflow, and all I could find was about image smoothing, and not about x,y movement smoothing.

Thanks in advance.

3

There are 3 best solutions below

3
Jordan On

If loader.content contains a Bitmap instance, that is your problem. Bitmap automatically snap to a full pixel unlike MovieClip and Sprite. You can change this behavior by setting the pixelSnapping property.

0
reissbaker On

If it's choppy only on certain, infrequent frames, it could be the garbage collector doing a sweep in the middle of your movement and causing a slight stutter in performance.

0
Pedro Guglielmo On

I solved this by changing x,y movement to a scaleX and scaleY "movement". As I was using a mask over a big photo, it looks like moving when I scale the photo, but it actualy is scaling.

I know this is not a good answer, but it temporarily solved my problem, since I didn't realy now why in this specific case x,y movement was not smooth. Maybe helps someone with same problem.