AnimateBitmapMaterials can be dynamicly altered?

Software: Away3D 4.x

teckel, Newbie
Posted: 14 October 2011 07:33 AM   Total Posts: 11

Hi there,

I try to make a material that can ben modified at the run time.
In the doc i found the AnimateBitmapMaterials class.

Material is well applyed on the _playFiled but when, i add some new MovieClip inside the source movie clip of an AnimateBitmapMaterials (autoPlay=true) this doesn’t affect the map directly (but the movieClip is added the the source clip.. tested).

_playFieldMap = new AnimatedBitmapMaterial(_shell,false,true)
_playField = new Plane(_playFieldMap,256,64,5,5)
_playField.addEventListener(MouseEvent3D.MOUSE_DOWN,touchBeginHanlder)

protected function 
touchBeginHanlder(e:MouseEvent3D):void{
 
        
 
if (!_shell.contains(_line)){
   
  _shell
.addChild(_line)
  
trace ("adding the line ")
        
}
        _playFieldMap
.updateTexture()
   

There is another material that can do this?
Thank fo hepl

   

Arno, Newbie
Posted: 14 October 2011 08:06 AM   Total Posts: 25   [ # 1 ]

Have you tried this to change

_playFieldMap.updateTexture() 

into:

_playFieldMap.setMovie(_shell); 

The AnimatedBitmapMaterial class is making bitmapdata’s for every frame. And with the updateTexture() he isn’t redrawing it.

 

   

teckel, Newbie
Posted: 14 October 2011 08:55 AM   Total Posts: 11   [ # 2 ]

Hi Arno,

It seem’s to be not working :(

I post the swf.

View the movie here

   

teckel, Newbie
Posted: 14 October 2011 09:08 AM   Total Posts: 11   [ # 3 ]

Oups sorry
Just Drag on the plane to see the action

   

Arno, Newbie
Posted: 14 October 2011 09:30 AM   Total Posts: 25   [ # 4 ]

AnimatedBitmapMaterial is only working for frame based movieclips (the Flash way with keyframes and all)

If you say new movieclip() you get a movieclip with only 1 frame and the AnimatedBitmapMaterial only contains 1 frame that he loops.

You could also try to draw every frame yourself and push them to the AnimatedBitmapMaterial with setMaps(source:array).

edit:

or for testing you could bitmapdraw the movieclip every onenterframe and set it on the plane. (will be to slow for a big project but should work for now)

   

teckel, Newbie
Posted: 14 October 2011 09:50 AM   Total Posts: 11   [ # 5 ]

Is there another material class to do this?

Drawing bitmapData… humm not so bad idea but i look for a more light solution smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X