hi guys, I really do not understand why it does not work, I just tried
to load a jpeg image, normal size, and from there I created a Plane
with this BitmapMaterial, then I add the scene, here is my code
simplified and the error it gives me an error : Bitmap Not valid
private function loadNextPlane() {
var loaderContext:LoaderContext = new LoaderContext ();
loaderContext.checkPolicyFile = true;
var imageLoader:Loader = new Loader();
imageLoader.contentLoaderInfo.addEventListener(
Event.COMPLETE,
imageLoaded );
imageLoader.load( new URLRequest( (this.projectsListData
[currentIndex] as Project).image ), loaderContext );
}
function imageLoaded (e : Event ) : void {
var loadedBmp : Bitmap = e.target.content as Bitmap;
var bmp:BitmapData = new BitmapData(loadedBmp.width,
loadedBmp.height,
true,
0x00000000
);
createPlane(bmp);
}
public function createPlane(bmp:BitmapData):void{
var plane:Plane = null;
var newWidth:Number = 310;
var newHeight:Number = 190;
var planeMaterial:BitmapMaterial = null;
planeMaterial = new BitmapMaterial(bmp);
planeMaterial.smooth= true;
plane = new Plane( {material :planeMaterial
,width: newWidth,
height:newHeight,segmentsW:4, segmentsH:4});
plane.x=300;
// delete the loaded iamge
bmp.dispose();
plane.extra = {planeIndex : 1, height: newHeight};
scene.addChild(plane);
planes.push(plane);
}
shame I'm stuck at the beginning, yet I understand away3d through
every demo, and tutorials
Please help !!!!!