I think by "much better", you speak about the smoothing of the
material...

Try to replace your 1st line of your ImageLoaded() function by :

var planeMaterial:BitmapMaterial = new
BitmapMaterial(Cast.bitmap(e.target.content), {smooth:true, precision:
2});

Alexandre.


On 17 fév, 16:13, metSyS <[email protected]> wrote:
> Embeded images which I'm using as BitmapMaterial are much better then
> loaded. Why?
>
> For example :
>
> [Embed(source="images/01t55.jpg")] private var Image01t55:Class;
> private var Bitmap01t55:Bitmap = new Image01t55();
>
> private var Material01t55:BitmapMaterial=new
> BitmapMaterial(Cast.bitmap(Bitmap01t55), {smooth:true, precision:2});
> ...
> Cube01=new Cube({name:"cube01", width:220, height:150, depth:5, x:351,
> y:246, material:Material01t55});
> view.scene..addChild(Cube01);
>
> are much better, then :
>
> var picLoader:Loader=new Loader();
> picLoader.load(new URLRequest("data/images/01t55.jpg"));
> picLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
> ImageLoaded);
>
> private function ImageLoaded(e:Event):void
> {
>        var planeMaterial:BitmapMaterial = new
> BitmapMaterial(Cast.bitmap(e.target.content));
>        Cube01=new Cube({name:"cube01", width:220, height:150, depth:5,
> x:351, y:246, material:planeMaterial});
>        view.scene..addChild(Cube01);
>
> }
>
> May be I'm doing something wrong with Loader.

Reply via email to