I have picked this code from a turorial site and so far i can see there is nothing wrong but when i run this in the flash 11 debugger with flash builder 4.6 i get only a black screen with nothing in it. I have used the flash away3d 4.1 gold edition
package
{
import away3d.containers.View3D;
import away3d.controllers.HoverController;
import away3d.entities.Mesh;
import away3d.materials.ColorMaterial;
import away3d.materials.SkyBoxMaterial;
import away3d.materials.TextureMaterial;
import away3d.primitives.CubeGeometry;
import away3d.primitives.PlaneGeometry;
import away3d.primitives.SkyBox;
import away3d.textures.BitmapCubeTexture;
import flash.display.ColorCorrection;
import flash.display.Sprite;
import flash.display3D.textures.Texture;
import flash.events.Event;
import flash.geom.Vector3D;
[SWF(width=640, height=480, frameRate=60)]
public class BreakingAway extends Sprite
{
[Embed(source="1.png")]
private var I1:Class;
[Embed(source="2.png")]
private var I2:Class;
[Embed(source="3.png")]
private var I3:Class;
[Embed(source="4.png")]
private var I4:Class;
[Embed(source="5.png")]
private var I5:Class;
[Embed(source="6.png")]
private var I6:Class;
private var view:View3D;
private var cube:Mesh;
private var hc:HoverController;
public function BreakingAway()
{
setupScene();
}
private function setupScene():void
{
view = new View3D();
addChild(view);
var bct:BitmapCubeTexture = new BitmapCubeTexture(new I1().bitmapData,
new I2().bitmapData,new I3().bitmapData,new I4().bitmapData,new I5().bitmapData,new I6().bitmapData);
cube = new Mesh(new CubeGeometry(), new SkyBoxMaterial(bct));
view.scene.addChild(cube);
view.camera.z = -500;
view.camera.y = 300;
view.camera.lookAt(new Vector3D());
hc = new HoverController(view.camera, null, 150, 10, 200);
addEventListener(Event.ENTER_FRAME, loop);
}
protected function loop(event:Event):void
{
hc.panAngle = mouseX - 320;
hc.tiltAngle = mouseY - 240;
view.render();
}
}
}