Glad I've helped you.
I hope more will try this material. For no interaction or single mousedowns cases, it is more efficient than the moviematerial.

Fabrice

On Oct 2, 2009, at 12:25 AM, Crisstyle wrote:


I have implemented it exactly as you said. Here is the code:

animatedMat:AnimatedBitmapMaterial = new AnimatedBitmapMaterial(new
Shooter1() ,  {autoplay:true, loop:false});
var material:AnimatedBitmapMaterial = animatedMat;
var shooterPlane:Plane = new Plane({material: material, smooth: true,
rotationX: 90, z: _zPos, width: 150, height: 275, x: _xPos, y:
_yPos});
material.index = 1;

This worked great.

Thanks Fabrice!


On Oct 1, 1:10 am, Fabrice3D <[email protected]> wrote:
Hi Crisstyle,
Here a few lines to get you started

first a little word on its principle:
the animatedBitmapMaterial is way to display animated textures at very low cost. cost being only done during init, or when sources are updated.
it generates a series of bitmapdata's from a source movieclip if one
is passed, cache them, and toggle at runtime automatically between them.

You can feed it with prepared code generated bitmapdata's as well.
For instance, if you generate perlin noise animations and feed it with the results, you can then runtime animate the generated bitmapsequence.
It can this way also be used/combine to animate/distort meshes for
instance.
it is a very powerfull animation feature once you master it.

Once its filled, it runs as fast as the BitmapMaterial. Its highly
recommanded to use it above MovieMaterial if your animation are set in
a loop or if no interaction is required.

you can set it like this:
var animMat: AnimatedBitmapMaterial = new AnimatedBitmapMaterial(new
someMovieclipWithFewFrames() ,  {autoplay:true, loop:true});

a bit like a movieclip, you can then at runtime do
animMat.stop();
animMat.play();

or if you need a goto like, just say
animMat.index = 3;  index is zero based

if you generate custom sources or want to change
animMat.setFrames([bmd0,bmd1,bmd2]);

if you want clear older data and replace from movieclip sources you
can do like this
animMat. clear();
animMat. setMovie(new SomeOtherMovieClip());

you also can let it run on itself like this:
animMat .autoplay = true;
animMat .loop = true.

Hope it helps...

Fabrice

On Oct 1, 2009, at 2:06 AM, Crisstyle wrote:



I have been trying to find a tutorial or any type of documentation on
AnimatedBitmapMaterial, but there isnt anything good out there.

Can provide a basic tutorial for this? I have been attempted to use
this with no success.

Thank you.

Reply via email to