Flash papervision3d load dae model from server

569 Views Asked by At

Trying to load DAE model using papervision3d in Flash AS3. I want that after user opens swf file it loads DAE model and texture from other server.

I'm using this code to link the model:

ModelDAE.load( "http://someurl.com/model.dae", materialsList);

After compiling it with flash it works good. But after i upload my swf file to web, it dont work, shows empty screen.

If I put DAE model ant texture in the same server and in the same folder together and linking model like this: "model.dae" it's working. But I want that model would be loaded from other server.

Thanks for any advice.

ALL CODE:

package 
{
import flash.display.Bitmap;
import flash.events.Event;
import org.papervision3d.materials.BitmapFileMaterial;
import org.papervision3d.materials.utils.MaterialsList;
import org.papervision3d.objects.parsers.DAE;
import org.papervision3d.view.BasicView;


public class ProjectDAE extends BasicView
{
    private var ModelDAE:DAE;
    protected var bitmapMaterial:BitmapFileMaterial;

    public function ProjectDAE () 
    {
        this.loaderInfo.addEventListener ( Event.COMPLETE, onFullyLoaded );
    }

    private function onFullyLoaded(e:Event):void 
    {
        bitmapMaterial  = new BitmapFileMaterial( "http://....jpg");
        var materialsList:MaterialsList = new MaterialsList ( ) ;
        materialsList.addMaterial ( bitmapMaterial, "all" ) ;           

        ModelDAE = new DAE();
        ModelDAE.load( "http://....dae", materialsList);
        this.scene.addChild(ModelDAE);

        this.startRendering ( ) ;
    }


    override protected function onRenderTick(event:Event = null):void 
    {
        super.onRenderTick ( event );
    }
}
}
1

There are 1 best solutions below

0
On

Probably a cross-domain issue, refer to http://kb2.adobe.com/cps/142/tn_14213.html