help: remove Plane from scene (papervision3d)
I am working with papervision3d to display photos from a gallery. With the code below, it is straight forward to load a single image at a time into the 3d renderer.
The problem is: When a new photo is loaded, it only partially loads atop the previous photo. I need some way to remove the previous photo/plane.
PHP Code:
public function load_image():void {
photo_loader = new Loader();
photo_loader.load(new URLRequest(gallery_list[photo_num]));
photo_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, image_loading);
photo_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, image_loaded);
}
public function image_loaded(e:Event):void {
mat = new BitmapFileMaterial(gallery_list[photo_num]);
plane = new Plane(mat, 600, 450, 4, 4);
scene.addChild(plane);
camera.zoom = 100;
renderer.renderScene(scene, camera, viewport);
}
public function image_loading(e:ProgressEvent):void {}
I've tried
PHP Code:
scene.removeChild(plane);
Thanks,