package { import away3d.containers.View3D; import away3d.lights.DirectionalLight3D; import away3d.materials.PhongColorMaterial; import away3d.primitives.Sphere; import flash.display.Sprite; [SWF(width="500", height="200", frameRate="60", backgroundColor="#FFFFFF")] public class Basic09_PhongColorMaterial extends Sprite { public function Basic09_PhongColorMaterial() { var view:View3D = new View3D({x:250,y:100}); addChild(view); // The same, using verbose syntax var colorMaterial:PhongColorMaterial = new PhongColorMaterial(0xFFA500); var sphere:Sphere = new Sphere(); sphere.material = colorMaterial; view.scene.addChild(sphere); // We'll need some light sources to see anything var light:DirectionalLight3D = new DirectionalLight3D(); view.scene.addChild(light); // Move the light away from the default 0,0,0 position so we'll see some reflection light.y = 500; light.x = -300; light.z = -200; // Render the view view.render(); } } }