This page is a rotating AWD character with texture exported from 3DS MAX 2012 that works locally, but when uploaded to the web the #2032 Stream Error: URL: http://frogmandesignz.com/away3d/gyroscope/model/Character.AWD is thrown. Which if you go to the model directory you’ll see the ‘Character.AWD’ file.
package{
import away3d.cameras.Camera3D;
import away3d.containers.Scene3D;
import away3d.containers.View3D;
import away3d.controllers.HoverController;
import away3d.loaders.Loader3D;
import away3d.loaders.parsers.Parsers;
import flash.display.Sprite;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Vector3D;
import flash.net.URLRequest;
[SWF(backgroundColor="#000000", frameRate="60", quality="LOW")]
public class Gyro2 extends Sprite {
private var _view:View3D;
private var _scene:Scene3D;
private var _camera:Camera3D;
private var _loader:Loader3D;
private var hoverController:HoverController;
private var _prevMouseX:Number;
private var _prevMouseY:Number;
public function Gyro2(){
Parsers.enableAllBundled();
setup3d();
}
private function setup3d():void{
stage.scaleMode = StageScaleMode.EXACT_FIT;
_view = addChild(new View3D()) as View3D;
_view.antiAlias = 4;
_view.backgroundColor = 0x000000;
_view.width = 600;
_view.height = 400;
_scene = _view.scene;
_camera = _view.camera;
_camera.lens.far = 5000;
_camera.lens.near = 20;
hoverController = new HoverController(_camera);
hoverController.tiltAngle = 0;
hoverController.panAngle = 180;
hoverController.minTiltAngle = -60;
hoverController.maxTiltAngle = 60;
stage.addEventListener(MouseEvent.MOUSE_DOWN, onStageMouseDown);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onStageMouseMove);
stage.addEventListener(MouseEvent.MOUSE_WHEEL, onStageMouseWheel);
_loader = new Loader3D(true, null);
_loader.load( new URLRequest("model/Character.AWD"));
_scene.addChild( _loader );
_loader.scaleX = _loader.scaleY = _loader.scaleZ = 6;
_loader.y = -250;
_loader.x = 100;
addEventListener( Event.ENTER_FRAME, render );
}
private function onStageMouseDown(event:MouseEvent):void{
_prevMouseX = event.stageX;
_prevMouseY = event.stageY;
}
private function onStageMouseMove(ev:MouseEvent):void{
if (ev.buttonDown) {
hoverController.panAngle += (ev.stageX - _prevMouseX);
hoverController.tiltAngle += (ev.stageY - _prevMouseY);
}
_prevMouseX = ev.stageX;
_prevMouseY = ev.stageY;
}
private function onStageMouseWheel(ev:MouseEvent):void{
hoverController.distance -= ev.delta * 5;
if (hoverController.distance < 100)
hoverController.distance = 100;
else if (hoverController.distance > 2000)
hoverController.distance = 2000;
}
private var _angleX:Number = 0;
private var _angleY:Number = 0;
private var _angleZ:Number = 0;
private function render( e:Event ):void{
_camera.lookAt(new Vector3D());
_view.render();
}
}
}
Going to see if any traces reveal some hints, because everything I looked up hasn’t helped.
Any ideas, questions, solutions?