Re: [Flashcoders] smooth animations? AS3

2008-09-04 Thread Matthias Dittgen
I had a similar problem a short while ago and the solution is quite easy.

1.) You have to turn smoothing on (for library symbol too by checking
the checkbox in the dialog) by dynamic Bitmaps using smoothing
property.
2.) You have to set PixelSnapping to NEVER for Bitmaps by code.
3.) and the most important: just scale your Bitmap and/or
MovieClip/Sprite to a value near but not equal to 1, e.g. scaleX =
scaleY = 0.99!
By scaling your MovieClip you'll force FlashPlayer to calculate
subpixels! That is doing the trick!

Good luck!
Matthias

On Thu, Sep 4, 2008 at 5:57 AM, Zeh Fernando [EMAIL PROTECTED] wrote:
 There are two things wrong with that example:

 One, the square image you have has an outline. Because of the way Flash
 renders outlines, it'll always snap perfectly vertical and horizontal lines
 to the pixel, hence producing what looks like a hard bitmap move. In fact,
 if you cut a diagonal line on the square and try to move it, you'll notice
 only the vertical and horizontal sides will snap, which is pretty odd (but
 expected behavior). Turning on stroke hinting actually forces this same
 behavior for all lines.

 And two, you turned on bitmap caching (use runtime bitmap caching) for the
 object, which forces it to render as a bitmap on round pixels and then
 transfer to the screen. Your object acts like a bitmap with
 smoothing/antialias off.

 So if you turn bitmap caching off and remove the outline and it'll work.
 Check it out:

 http://hosted.zeh.com.br/misc/test.swf

 These techniques are only good for this example scenario though, which
 probably isn't the problem that you're facing on your actual work (specially
 if you're using images or text), so you'll have to test to see what's up
 with your specific case.

 But what I can tell you is, don't use runtime bitmap caching as default. Not
 only because it'll force your renders to be based on the pixel most of the
 times, but because it'll mess with your movies in a number of different ways
 like forcing a large use of memory and garbage collection when not needed.
 Don't get me wrong, it's a great feature to have, but it has to be used
 sparingly and there's a reason why it's off by default.

 Zeh

 sebastian wrote:

 ok I don't normally ask this, but I have made a very simple test flash
 file with just one vector graphic and with Tweener I am moving it across the
 screen; it doesn't move smoothly.

 The code you will find in my flash file is just this:

 package {
import flash.display.MovieClip;
import caurina.transitions.Tweener;

//main timeline AS file:
public class testas extends MovieClip {
  public function testas () {

setAnimation2 ();
  }
  private function setAnimation2 () {
  Tweener.addTween (testMC, {x:-1800, time:8000,
 transition:linear});
  }
  }
 }

 the file with my FLA, which like I said has only one vector-item of a
 square on the timeline is:

 http://www.fountain-city.com/archives/test/testMotion.zip

 Can anyone help me fix this?
 Much appreciated!

 thanks!

 seb.

 sebastian wrote:

 also I tried replacing my PNG with a simple vector of a square, but it
 STILL skips as it moves every pixel... surely I am still missing something
 simple here...
 hmmm

 sebastian wrote:

 Thanks Jack and Zeh,

 I have the bitmap smoothing on on the image's properties in the library,
 and I also turned on for every MC it is placed in 'use runtime bitmap
 caching' but i STILL get staggered movement...
 :(((

 It's nothing complicated, aside from using the Tweener AS3 class, I'm
 trying to move PNG's [with transparencies] over a BG image. The blend mode
 on all layers is set to 'normal'. No alpha is being used except for the
 inherent PNG's alphaness. I've also tried setting the bitmapCaching at
 runtime to the holding MC, but none of this is helping...

 Any other suggestions? Am I still missing something? Is the PNG the
 problem?

 Thanks,

 Sebastian.

 Zeh Fernando wrote:

 I have tried basic timeline motion tween, and also the AS3 Tweener
 class; but in both cases I get the issue that the slow animation makes 
 the
 image do little 1 pixel jumps that are VERY visible and break the effect 
 I
 am going for [which needs to be extremely subtle].

 If that's an image, set its anti-alias to antialias for animation. If
 it's a bitmap, turn on smoothing on it (on the library). If it's a loaded
 bitmap, turn on the Bitmap's antialias.

 Zeh
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 

RE: [Flashcoders] smooth animations? AS3

2008-09-04 Thread Cor
Loose the tween.
Use the Timer class and update your x or whatever at a amount of
milliseconds.
Framerate is never reliable


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of sebastian
Sent: donderdag 4 september 2008 5:04
To: Flash Coders List
Subject: Re: [Flashcoders] smooth animations? AS3

ok I don't normally ask this, but I have made a very simple test flash 
file with just one vector graphic and with Tweener I am moving it across 
the screen; it doesn't move smoothly.

The code you will find in my flash file is just this:

package {
import flash.display.MovieClip;

import caurina.transitions.Tweener;

//main timeline AS file:
public class testas extends MovieClip {

public function testas () {

setAnimation2 ();

}

private function setAnimation2 () {

Tweener.addTween (testMC, {x:-1800, time:8000,
transition:linear});

}

}
}

the file with my FLA, which like I said has only one vector-item of a 
square on the timeline is:

http://www.fountain-city.com/archives/test/testMotion.zip

Can anyone help me fix this?
Much appreciated!

thanks!

seb.

sebastian wrote:
 also I tried replacing my PNG with a simple vector of a square, but it 
 STILL skips as it moves every pixel... surely I am still missing 
 something simple here...
 hmmm
 
 sebastian wrote:
 Thanks Jack and Zeh,

 I have the bitmap smoothing on on the image's properties in the 
 library, and I also turned on for every MC it is placed in 'use 
 runtime bitmap caching' but i STILL get staggered movement...
 :(((

 It's nothing complicated, aside from using the Tweener AS3 class, I'm 
 trying to move PNG's [with transparencies] over a BG image. The blend 
 mode on all layers is set to 'normal'. No alpha is being used except 
 for the inherent PNG's alphaness. I've also tried setting the 
 bitmapCaching at runtime to the holding MC, but none of this is 
 helping...

 Any other suggestions? Am I still missing something? Is the PNG the 
 problem?

 Thanks,

 Sebastian.

 Zeh Fernando wrote:
 I have tried basic timeline motion tween, and also the AS3 Tweener 
 class; but in both cases I get the issue that the slow animation 
 makes the image do little 1 pixel jumps that are VERY visible and 
 break the effect I am going for [which needs to be extremely subtle].

 If that's an image, set its anti-alias to antialias for animation. If 
 it's a bitmap, turn on smoothing on it (on the library). If it's a 
 loaded bitmap, turn on the Bitmap's antialias.

 Zeh
 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


 
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] smooth animations? AS3

2008-09-04 Thread Zeh Fernando
Modern tween engines (including the one used on his example) by default 
do not use the framerate as the base for calculation but rather the time 
spent since the animation has started (even if they only update on frame 
events). Replacing it with a timer class will produce the same result. 
His problem is with asset and not with calculation of the new position 
or with time accuracy.


Zeh

Cor wrote:

Loose the tween.
Use the Timer class and update your x or whatever at a amount of
milliseconds.
Framerate is never reliable


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of sebastian
Sent: donderdag 4 september 2008 5:04
To: Flash Coders List
Subject: Re: [Flashcoders] smooth animations? AS3

ok I don't normally ask this, but I have made a very simple test flash 
file with just one vector graphic and with Tweener I am moving it across 
the screen; it doesn't move smoothly.


The code you will find in my flash file is just this:

package {
import flash.display.MovieClip;

import caurina.transitions.Tweener;

//main timeline AS file:
public class testas extends MovieClip {

public function testas () {

setAnimation2 ();

}

private function setAnimation2 () {

Tweener.addTween (testMC, {x:-1800, time:8000,
transition:linear});

}

}
}

the file with my FLA, which like I said has only one vector-item of a 
square on the timeline is:


http://www.fountain-city.com/archives/test/testMotion.zip

Can anyone help me fix this?
Much appreciated!

thanks!

seb.

sebastian wrote:
also I tried replacing my PNG with a simple vector of a square, but it 
STILL skips as it moves every pixel... surely I am still missing 
something simple here...

hmmm

sebastian wrote:

Thanks Jack and Zeh,

I have the bitmap smoothing on on the image's properties in the 
library, and I also turned on for every MC it is placed in 'use 
runtime bitmap caching' but i STILL get staggered movement...

:(((

It's nothing complicated, aside from using the Tweener AS3 class, I'm 
trying to move PNG's [with transparencies] over a BG image. The blend 
mode on all layers is set to 'normal'. No alpha is being used except 
for the inherent PNG's alphaness. I've also tried setting the 
bitmapCaching at runtime to the holding MC, but none of this is 
helping...


Any other suggestions? Am I still missing something? Is the PNG the 
problem?


Thanks,

Sebastian.

Zeh Fernando wrote:
I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation 
makes the image do little 1 pixel jumps that are VERY visible and 
break the effect I am going for [which needs to be extremely subtle].
If that's an image, set its anti-alias to antialias for animation. If 
it's a bitmap, turn on smoothing on it (on the library). If it's a 
loaded bitmap, turn on the Bitmap's antialias.


Zeh
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] smooth animations? AS3

2008-09-04 Thread sebastian
Thank you everyone for all of your great help, I think I know now enough 
to be able to resolve the issue. Complexities arise in my MC because I 
need bitmapcaching on to get correct alpha's to work, so I'm thinking up 
solutions and workarounds...

:P

All the best,

Sebastian.

Zeh Fernando wrote:
Modern tween engines (including the one used on his example) by default 
do not use the framerate as the base for calculation but rather the time 
spent since the animation has started (even if they only update on frame 
events). Replacing it with a timer class will produce the same result. 
His problem is with asset and not with calculation of the new position 
or with time accuracy.


Zeh

Cor wrote:

Loose the tween.
Use the Timer class and update your x or whatever at a amount of
milliseconds.
Framerate is never reliable


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of sebastian
Sent: donderdag 4 september 2008 5:04
To: Flash Coders List
Subject: Re: [Flashcoders] smooth animations? AS3

ok I don't normally ask this, but I have made a very simple test flash 
file with just one vector graphic and with Tweener I am moving it 
across the screen; it doesn't move smoothly.


The code you will find in my flash file is just this:

package {
import flash.display.MovieClip;

import caurina.transitions.Tweener;


//main timeline AS file:
public class testas extends MovieClip {
   
public function testas () {


setAnimation2 ();
   
}
   
private function setAnimation2 () {
   
Tweener.addTween (testMC, {x:-1800, time:8000,

transition:linear});
   
}
   
}

}

the file with my FLA, which like I said has only one vector-item of a 
square on the timeline is:


http://www.fountain-city.com/archives/test/testMotion.zip

Can anyone help me fix this?
Much appreciated!

thanks!

seb.

sebastian wrote:
also I tried replacing my PNG with a simple vector of a square, but 
it STILL skips as it moves every pixel... surely I am still missing 
something simple here...

hmmm

sebastian wrote:

Thanks Jack and Zeh,

I have the bitmap smoothing on on the image's properties in the 
library, and I also turned on for every MC it is placed in 'use 
runtime bitmap caching' but i STILL get staggered movement...

:(((

It's nothing complicated, aside from using the Tweener AS3 class, 
I'm trying to move PNG's [with transparencies] over a BG image. The 
blend mode on all layers is set to 'normal'. No alpha is being used 
except for the inherent PNG's alphaness. I've also tried setting the 
bitmapCaching at runtime to the holding MC, but none of this is 
helping...


Any other suggestions? Am I still missing something? Is the PNG the 
problem?


Thanks,

Sebastian.

Zeh Fernando wrote:
I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation 
makes the image do little 1 pixel jumps that are VERY visible and 
break the effect I am going for [which needs to be extremely subtle].
If that's an image, set its anti-alias to antialias for animation. 
If it's a bitmap, turn on smoothing on it (on the library). If it's 
a loaded bitmap, turn on the Bitmap's antialias.


Zeh
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] smooth animations? AS3

2008-09-03 Thread Jack Doyle
If you want sub-pixel movement, you must turn smoothing on for the asset,
but there are a few gotchas that I'm aware of:

1) If DisplayObject/MovieClip has any filters applied to it (blur, drop
shadow, etc.), I'm pretty sure it's impossible to get sub-pixel movement. It
will only move on whole pixels which would explain that undesirable effect
you described.

2) If you're animating a TextField with anti-aliasing set to anti-alias for
readability, you'll probably get some visual vibration as it moves.
Obviously bitmap text (no anti-aliasing) won't work well for sub-pixel
movement.

3) In certain scenarios, Flash will not allow smoothing on subloaded assets
from other domains unless you have a crossdomain.xml file in place. It's a
security thing.

If your asset is a raster image in your library, you can simply right-click
on it, choose properties, and select the allow smoothing checkbox. If it's
a BitmapData object, you'll need to enable smoothing when you create it
through code. 

If it's not a raster image, could try creating a BitmapData of your asset,
set smoothing to true, and animate that in order to get the sub-pixel
movement. Not sure it would give you great results, but it's worth a shot.

Hope that helps.

Jack

-Original Message-
From: sebastian [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 03, 2008 7:50 PM
To: Flash Coders List
Subject: [Flashcoders] smooth animations? AS3

Hi everyone, so I have a MC I want to move very-very slowly across the 
screen; so that it is subtle. I have the frame rate set to 30fps and any 
increase to the FPS doesn't seem to make much of a difference.

I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation makes 
the image do little 1 pixel jumps that are VERY visible and break the 
effect I am going for [which needs to be extremely subtle].

Am I just stuffed? Or is there a way to achieve very smooth animations 
in Flash/AS3? [short of laying it all out as frames and cross fading! 
which would be ridiculous and over-size the file so not possible]. Maybe 
I just need to turn on something somewhere? I can't remember where if 
that's the case...

Thanks!!

Sebastian.




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] smooth animations? AS3

2008-09-03 Thread Zeh Fernando
I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation makes 
the image do little 1 pixel jumps that are VERY visible and break the 
effect I am going for [which needs to be extremely subtle].


If that's an image, set its anti-alias to antialias for animation. If 
it's a bitmap, turn on smoothing on it (on the library). If it's a 
loaded bitmap, turn on the Bitmap's antialias.


Zeh
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] smooth animations? AS3

2008-09-03 Thread sebastian

Thanks Jack and Zeh,

I have the bitmap smoothing on on the image's properties in the library, 
and I also turned on for every MC it is placed in 'use runtime bitmap 
caching' but i STILL get staggered movement...

:(((

It's nothing complicated, aside from using the Tweener AS3 class, I'm 
trying to move PNG's [with transparencies] over a BG image. The blend 
mode on all layers is set to 'normal'. No alpha is being used except for 
the inherent PNG's alphaness. I've also tried setting the bitmapCaching 
at runtime to the holding MC, but none of this is helping...


Any other suggestions? Am I still missing something? Is the PNG the problem?

Thanks,

Sebastian.

Zeh Fernando wrote:
I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation makes 
the image do little 1 pixel jumps that are VERY visible and break the 
effect I am going for [which needs to be extremely subtle].


If that's an image, set its anti-alias to antialias for animation. If 
it's a bitmap, turn on smoothing on it (on the library). If it's a 
loaded bitmap, turn on the Bitmap's antialias.


Zeh
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] smooth animations? AS3

2008-09-03 Thread sebastian
also I tried replacing my PNG with a simple vector of a square, but it 
STILL skips as it moves every pixel... surely I am still missing 
something simple here...

hmmm

sebastian wrote:

Thanks Jack and Zeh,

I have the bitmap smoothing on on the image's properties in the library, 
and I also turned on for every MC it is placed in 'use runtime bitmap 
caching' but i STILL get staggered movement...

:(((

It's nothing complicated, aside from using the Tweener AS3 class, I'm 
trying to move PNG's [with transparencies] over a BG image. The blend 
mode on all layers is set to 'normal'. No alpha is being used except for 
the inherent PNG's alphaness. I've also tried setting the bitmapCaching 
at runtime to the holding MC, but none of this is helping...


Any other suggestions? Am I still missing something? Is the PNG the 
problem?


Thanks,

Sebastian.

Zeh Fernando wrote:
I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation 
makes the image do little 1 pixel jumps that are VERY visible and 
break the effect I am going for [which needs to be extremely subtle].


If that's an image, set its anti-alias to antialias for animation. If 
it's a bitmap, turn on smoothing on it (on the library). If it's a 
loaded bitmap, turn on the Bitmap's antialias.


Zeh
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] smooth animations? AS3

2008-09-03 Thread sebastian
ok I don't normally ask this, but I have made a very simple test flash 
file with just one vector graphic and with Tweener I am moving it across 
the screen; it doesn't move smoothly.


The code you will find in my flash file is just this:

package {
import flash.display.MovieClip;

import caurina.transitions.Tweener;

//main timeline AS file:
public class testas extends MovieClip {

public function testas () {

setAnimation2 ();

}

private function setAnimation2 () {

Tweener.addTween (testMC, {x:-1800, time:8000, 
transition:linear});

}

}
}

the file with my FLA, which like I said has only one vector-item of a 
square on the timeline is:


http://www.fountain-city.com/archives/test/testMotion.zip

Can anyone help me fix this?
Much appreciated!

thanks!

seb.

sebastian wrote:
also I tried replacing my PNG with a simple vector of a square, but it 
STILL skips as it moves every pixel... surely I am still missing 
something simple here...

hmmm

sebastian wrote:

Thanks Jack and Zeh,

I have the bitmap smoothing on on the image's properties in the 
library, and I also turned on for every MC it is placed in 'use 
runtime bitmap caching' but i STILL get staggered movement...

:(((

It's nothing complicated, aside from using the Tweener AS3 class, I'm 
trying to move PNG's [with transparencies] over a BG image. The blend 
mode on all layers is set to 'normal'. No alpha is being used except 
for the inherent PNG's alphaness. I've also tried setting the 
bitmapCaching at runtime to the holding MC, but none of this is 
helping...


Any other suggestions? Am I still missing something? Is the PNG the 
problem?


Thanks,

Sebastian.

Zeh Fernando wrote:
I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation 
makes the image do little 1 pixel jumps that are VERY visible and 
break the effect I am going for [which needs to be extremely subtle].


If that's an image, set its anti-alias to antialias for animation. If 
it's a bitmap, turn on smoothing on it (on the library). If it's a 
loaded bitmap, turn on the Bitmap's antialias.


Zeh
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] smooth animations? AS3

2008-09-03 Thread Zeh Fernando
Square vectors might still look like they're snapping if they have an 
outline.


Do you have a published example of that, as an SWF, so we can see and 
measure what kind of movement problem is it having?


Zeh

sebastian wrote:
also I tried replacing my PNG with a simple vector of a square, but it 
STILL skips as it moves every pixel... surely I am still missing 
something simple here...

hmmm

sebastian wrote:

Thanks Jack and Zeh,

I have the bitmap smoothing on on the image's properties in the 
library, and I also turned on for every MC it is placed in 'use 
runtime bitmap caching' but i STILL get staggered movement...

:(((

It's nothing complicated, aside from using the Tweener AS3 class, I'm 
trying to move PNG's [with transparencies] over a BG image. The blend 
mode on all layers is set to 'normal'. No alpha is being used except 
for the inherent PNG's alphaness. I've also tried setting the 
bitmapCaching at runtime to the holding MC, but none of this is 
helping...


Any other suggestions? Am I still missing something? Is the PNG the 
problem?


Thanks,

Sebastian.

Zeh Fernando wrote:
I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation 
makes the image do little 1 pixel jumps that are VERY visible and 
break the effect I am going for [which needs to be extremely subtle].


If that's an image, set its anti-alias to antialias for animation. If 
it's a bitmap, turn on smoothing on it (on the library). If it's a 
loaded bitmap, turn on the Bitmap's antialias.


Zeh
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] smooth animations? AS3

2008-09-03 Thread Zeh Fernando

There are two things wrong with that example:

One, the square image you have has an outline. Because of the way Flash 
renders outlines, it'll always snap perfectly vertical and horizontal 
lines to the pixel, hence producing what looks like a hard bitmap move. 
In fact, if you cut a diagonal line on the square and try to move it, 
you'll notice only the vertical and horizontal sides will snap, which 
is pretty odd (but expected behavior). Turning on stroke hinting 
actually forces this same behavior for all lines.


And two, you turned on bitmap caching (use runtime bitmap caching) for 
the object, which forces it to render as a bitmap on round pixels and 
then transfer to the screen. Your object acts like a bitmap with 
smoothing/antialias off.


So if you turn bitmap caching off and remove the outline and it'll work. 
Check it out:


http://hosted.zeh.com.br/misc/test.swf

These techniques are only good for this example scenario though, which 
probably isn't the problem that you're facing on your actual work 
(specially if you're using images or text), so you'll have to test to 
see what's up with your specific case.


But what I can tell you is, don't use runtime bitmap caching as default. 
Not only because it'll force your renders to be based on the pixel most 
of the times, but because it'll mess with your movies in a number of 
different ways like forcing a large use of memory and garbage collection 
when not needed. Don't get me wrong, it's a great feature to have, but 
it has to be used sparingly and there's a reason why it's off by default.


Zeh

sebastian wrote:
ok I don't normally ask this, but I have made a very simple test flash 
file with just one vector graphic and with Tweener I am moving it across 
the screen; it doesn't move smoothly.


The code you will find in my flash file is just this:

package {
import flash.display.MovieClip;

import caurina.transitions.Tweener;


//main timeline AS file:
public class testas extends MovieClip {
   
public function testas () {


setAnimation2 ();
   
}
   
private function setAnimation2 () {
   
Tweener.addTween (testMC, {x:-1800, time:8000, 
transition:linear});
   
}
   
}

}

the file with my FLA, which like I said has only one vector-item of a 
square on the timeline is:


http://www.fountain-city.com/archives/test/testMotion.zip

Can anyone help me fix this?
Much appreciated!

thanks!

seb.

sebastian wrote:
also I tried replacing my PNG with a simple vector of a square, but it 
STILL skips as it moves every pixel... surely I am still missing 
something simple here...

hmmm

sebastian wrote:

Thanks Jack and Zeh,

I have the bitmap smoothing on on the image's properties in the 
library, and I also turned on for every MC it is placed in 'use 
runtime bitmap caching' but i STILL get staggered movement...

:(((

It's nothing complicated, aside from using the Tweener AS3 class, I'm 
trying to move PNG's [with transparencies] over a BG image. The blend 
mode on all layers is set to 'normal'. No alpha is being used except 
for the inherent PNG's alphaness. I've also tried setting the 
bitmapCaching at runtime to the holding MC, but none of this is 
helping...


Any other suggestions? Am I still missing something? Is the PNG the 
problem?


Thanks,

Sebastian.

Zeh Fernando wrote:
I have tried basic timeline motion tween, and also the AS3 Tweener 
class; but in both cases I get the issue that the slow animation 
makes the image do little 1 pixel jumps that are VERY visible and 
break the effect I am going for [which needs to be extremely subtle].


If that's an image, set its anti-alias to antialias for animation. 
If it's a bitmap, turn on smoothing on it (on the library). If it's 
a loaded bitmap, turn on the Bitmap's antialias.


Zeh
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders






___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders