Hey guys,
I’m working on some concepts in Broomstick and I’ve got everything working fine locally but as soon as I upload it I get a debug player error from the FP11 Incubator and the SWF keeps flashing like its just broken. I’ve attached the image of the error I’m getting. The URL is here:
Here is the code I’m using to load the model and then display it:
package
{
import away3d.containers.View3D;
import away3d.debug.AwayStats;
import away3d.entities.Mesh;
import away3d.events.AssetEvent;
import away3d.library.AssetLibrary;
import away3d.lights.DirectionalLight;
import away3d.loaders.parsers.Max3DSParser;
import away3d.materials.BitmapMaterial;
import data.Data;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.DataLoader;
import com.greensock.loading.ImageLoader;
import com.greensock.loading.LoaderMax;
import com.li.away3d.camera.MKSOCameraController;
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Vector3D;
/**
* @author Matt Przybylski [http://www.reintroducing.com]
* @version 1.0
*/
public class Main extends Sprite
{
//- PRIVATE & PROTECTED VARIABLES -------------------------------------------------------------------------
private var _view:View3D;
private var _stats:AwayStats;
private var _queue:LoaderMax;
//- PUBLIC & INTERNAL VARIABLES ---------------------------------------------------------------------------
// 3D elements
public var camController:MKSOCameraController;
public var directionalLight:DirectionalLight;
//- CONSTRUCTOR -------------------------------------------------------------------------------------------
public function Main()
{
super();
init();
}
//- PRIVATE & PROTECTED METHODS ---------------------------------------------------------------------------
/**
*
*/
protected function init():void
{
Data.env.setPaths("../", "../"); // second path adjusted for External SWF Viewer in FDT
_view = new View3D();
_view.antiAlias = 2;
_view.camera.z = -300;
_view.camera.y = 200;
addChild(_view);
_stats = new AwayStats(_view);
addChild(_stats);
initLoading();
}
/**
*
*/
private function initLoading():void
{
_queue = new LoaderMax({name: "models", onComplete: handleModelsLoaded});
_queue.append(new DataLoader(String(Data.env.basePath + "models/setting/table_cloth.3ds"), {name: "tableCloth", format: "binary"}));
_queue.append(new ImageLoader(String(Data.env.basePath + "textures/p_one.jpg"), {name: "one", smoothing: true}));
_queue.load();
}
/**
*
*/
protected function handleAssetParseComplete($evt:AssetEvent):void
{
var tableCloth:Mesh = (AssetLibrary.getAsset("table_clot") as Mesh);
tableCloth.material = new BitmapMaterial(LoaderMax.getContent("one").rawContent.bitmapData);
_view.scene.addChild(tableCloth);
_view.scene.addChild(directionalLight);
addEventListener(Event.ENTER_FRAME, handleEnterFrame);
}
/**
*
*/
private function init3D():void
{
// set up the camera controller
camController = new MKSOCameraController(_view.camera);
addChildAt(camController, 0);
directionalLight = new DirectionalLight();
directionalLight.specular = .2;
directionalLight.direction = new Vector3D(-1, -1, 0);
AssetLibrary.enableParser(Max3DSParser);
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETE, handleAssetParseComplete);
AssetLibrary.parseData(LoaderMax.getContent("tableCloth"));
}
//- EVENT HANDLERS ----------------------------------------------------------------------------------------
/**
*
*/
protected function handleEnterFrame($evt:Event):void
{
camController.update();
_view.render();
}
/**
*
*/
protected function handleModelsLoaded($evt:LoaderEvent):void
{
init3D();
}
//- END CLASS ---------------------------------------------------------------------------------------------
}
}
Keep in mind as I said before, all this works fine locally. Can someone tell me if I’m doing something wrong?
Thanks,
Matt