[Papervision3D] BitmapFileMaterial problem
Claudio Burtschenko
claudio.burtschenko at chello.at
Mon Feb 4 22:59:00 PST 2008
hi guys,
one question about loading external image with BitmapFileMaterial:
if i make this the first time
createMaterial{
var material:BitmapFileMaterial=new BitmapFileMaterial(
"sample.jpg" );
material.addEventListener (FileLoadEvent.LOAD_COMPLETE, createMap);
.....
}
-> createMap...{creates a plane with the sample.jpg material}
when i say -> scene.removeChild (myPlane)
and i "createMaterial" the second time, FileLoadEvent.LOAD_COMPLETE doesn`t
fire createMap!!!???
it works just one time!?
when i try it with an another imagePath, it works the second time:
createMaterial{
var material:BitmapFileMaterial=new BitmapFileMaterial( PATH +
".jpg" );
material.addEventListener (FileLoadEvent.LOAD_COMPLETE, createMap);
.....
}
but also just one time!?!?
how can i load the same BitmapFileMaterial several times on an plane!?
did i forget something..
would be nice to get some help or ideas
cheers
c
FULL CODE:
function getMat () {
var material:BitmapFileMaterial=new BitmapFileMaterial(pathPic + j +
".jpg");
arr[j]=material;
material.addEventListener (FileLoadEvent.LOAD_COMPLETE, createMap);
material.oneSide = true;
material.smooth = true;
j++;
}
function createMap (event:FileLoadEvent) {
var p:Plane = new Plane(arr[i], 150, imageSize[i], 2, 2);
p.x = -250 + (165 * inX);
p.y = (45*(rows-inY)) + (-50* inY);
p.z = -2000;
p.rotationX=90;
p.visible=false;
scene.addChild (p);
if (i<picLength) {
getMat ();
}
i++;
}
<http://dict.leo.org/ende?lp=ende&p=eL4jU.&search=times>
More information about the Papervision3D
mailing list