<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16788" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm trying to get a phong shaded plane to work, 
with a 200x200 jpg applied to it, pretty simple I thought, but I keep running up 
against this error - </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Error #1007: Instantiation attempted on a 
non-constructor.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>which seems to be something to do with my trying to 
create a new instance of myBitmap(); code below, can you tell me what I'm doing 
wrong? bitmap.jpg resides in the root of ny web directory</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier size=2>package {</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier size=2>&nbsp;import 
flash.display.Bitmap;<BR>&nbsp;import flash.display.Sprite;<BR>&nbsp;import 
flash.events.Event;</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier size=2>&nbsp;import 
org.papervision3d.lights.PointLight3D;<BR>&nbsp;import 
org.papervision3d.cameras.*;<BR>&nbsp;import 
org.papervision3d.objects.primitives.*;<BR>&nbsp;import 
org.papervision3d.materials.*;<BR>&nbsp;import 
org.papervision3d.materials.shaders.PhongShader;<BR>&nbsp;import 
org.papervision3d.materials.shaders.ShadedMaterial;<BR>&nbsp;import 
org.papervision3d.render.*;<BR>&nbsp;import 
org.papervision3d.view.*;<BR>&nbsp;import 
org.papervision3d.scenes.*;<BR>&nbsp;import 
org.papervision3d.view.BasicView;<BR>&nbsp;<BR>&nbsp;</FONT><FONT 
size=2><BR><FONT face=Courier>&nbsp;public class myGallery extends Sprite 
{</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier>&nbsp;&nbsp;private var viewport:Viewport3D = new 
Viewport3D(0,0, true,true);<BR>&nbsp;&nbsp;private var 
renderer:BasicRenderEngine= new BasicRenderEngine();<BR>&nbsp;&nbsp;private var 
scene:Scene3D = new Scene3D();<BR>&nbsp;&nbsp;private var camera:Camera3D = new 
Camera3D();</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT 
face=Courier>&nbsp;&nbsp;[Embed(source="bitmap.jpg")]<BR>&nbsp;&nbsp;private var 
myBitmap:Class;</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier>&nbsp;&nbsp;<BR>&nbsp;&nbsp;<BR>&nbsp;&nbsp;public 
function myGallery() 
{<BR>&nbsp;&nbsp;&nbsp;initPapervision3D();<BR>&nbsp;&nbsp;}</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier>&nbsp;&nbsp;private function initPapervision3D():void 
{<BR>&nbsp;&nbsp;&nbsp;viewport = new 
Viewport3D();<BR>&nbsp;&nbsp;&nbsp;addChild(viewport);</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier>&nbsp;&nbsp;&nbsp;scene = new 
Scene3D();<BR>&nbsp;&nbsp;&nbsp;camera = new 
Camera3D();<BR>&nbsp;&nbsp;&nbsp;renderer = new 
BasicRenderEngine();<BR>&nbsp;&nbsp;&nbsp;var plane:Plane = new 
Plane(shadedMaterial);</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier>&nbsp;&nbsp;&nbsp;scene.addChild(plane);</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier>&nbsp;&nbsp;&nbsp;camera.z = 
-500;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;var bm:Bitmap = new 
myBitmap();<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;var light:PointLight3D = new 
PointLight3D();<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;var bitmapMaterial:BitmapMaterial 
= new BitmapMaterial(bm.bitmapData, true);<BR>&nbsp;&nbsp;&nbsp;var 
shader:PhongShader = new PhongShader(light, 0xffffff, 0x000000, 
10);<BR>&nbsp;&nbsp;&nbsp;var shadedMaterial:ShadedMaterial = new 
ShadedMaterial(bitmapMaterial, shader);</FONT></DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier></FONT>&nbsp;</DIV>
<DIV><FONT face=Courier>&nbsp;&nbsp;&nbsp;renderer.renderScene(scene, camera, 
viewport);<BR>&nbsp;&nbsp;}<BR>&nbsp;}<BR>}</FONT></FONT></DIV></BODY></HTML>