I would recommend using MovieMaterials where the contents of the
movieclip/sprite need to be animated or interactive. MovieMaterials
are re-drawn on every render (normally onEnterFrame) creating a huge
overhead.

In your setup you can create a single instance of Texture. Update the
copy as needed (create a public method to do so) and then use use
BitmapData.draw( mySprite ) to generate the image needed. You then use
a simple BitmapMaterial on the cube with the BitmapData.

something like:

private function createCubeObject( label:String ):void
{

var texture = new Texture(label);

var bmd:BitmapData = new BitmapData( 39, 39 );
bmd.draw( texture );

var c:Cube=new Cube();
c.material = new BitmapMaterial( bmd, {smooth: true});
}


The sizing issue might come from the textfield size. Try setting the
background and border to true to debug.
txt.background = true;
txt.border = true;

You may need to add a background shape (transparent) and also mask
shape to ensure it sizes correctly.

Reply via email to