Project works locally but errors online

Software: Away3D 4.x

mprzybylski, Newbie
Posted: 20 June 2011 08:55 PM   Total Posts: 6

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:

Flashing SWF

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.= -300;
   
_view.camera.200;
   
addChild(_view);
   
   
_stats = new AwayStats(_view);
   
addChild(_stats);
   
   
initLoading();
  
}
  
  
/**
   *
   */
  
private function initLoading():void
  {
   _queue 
= new LoaderMax({name"models"onCompletehandleModelsLoaded});
   
_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"smoothingtrue}));
   
_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_FRAMEhandleEnterFrame);
  
}
  
  
/**
   *
   */
  
private function init3D():void
  {
   
// set up the camera controller
   
camController = new MKSOCameraController(_view.camera);
   
addChildAt(camController0);
   
   
directionalLight = new DirectionalLight();
   
directionalLight.specular .2;
   
directionalLight.direction = new Vector3D(-1, -10);
   
   
AssetLibrary.enableParser(Max3DSParser);
   
AssetLibrary.addEventListener(AssetEvent.ASSET_COMPLETEhandleAssetParseComplete);
   
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

 

   

Avatar
Choons, Sr. Member
Posted: 20 June 2011 09:39 PM   Total Posts: 281   [ # 1 ]

I’d recommend opening the url in FireFox equipped with FireBug to trace out all the server requests and see if you can spot something there. My first uploaded broomstick project I didn’t have the swfobject.js uploaded in the right place so it wouldn’t load. The other thing I notice is you are using 3rd party loaders. Not sure if that is a problem or not but if Firebug shows no problems, you might consider using Away3D loader libraries instead to see if that makes a difference.

   

Avatar
Choons, Sr. Member
Posted: 20 June 2011 09:45 PM   Total Posts: 281   [ # 2 ]

yeah actually I just loaded it into my FireFox and Firebug is throwing 404 not found messages on your assets. Check your relative paths with where you put your assets

   

mprzybylski, Newbie
Posted: 20 June 2011 10:53 PM   Total Posts: 6   [ # 3 ]
Choons - 20 June 2011 09:45 PM

yeah actually I just loaded it into my FireFox and Firebug is throwing 404 not found messages on your assets. Check your relative paths with where you put your assets

You’re absolutely right!  If you look up at my code and see where i’m setting the environment paths I even have a comment in there to remind myself that I had to set that to work locally and then I totally forgot about it when I went online with the project.  I put the path back to what it should be and now its correct and working.  Thanks again for your help, Choons.

   

Avatar
Choons, Sr. Member
Posted: 20 June 2011 10:57 PM   Total Posts: 281   [ # 4 ]

yeah lol I have done that a few times myself. Glad you got it sorted

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X