[Papervision3D] Not Just Another MovieMaterial Question HEEEELPP!

Cyberfish johndaustin at gmail.com
Thu May 29 13:37:35 PDT 2008


Krystian thanks for responding.  I switched some code around and put the
movieclip var above the moviematerial var.  That, did not work
unfortunately.  On a sidenote, the error that I keep throwing is
replicated....forever it seems, or at least until flash freezes.  Im not
sure if this is relevant, but it also seems to be replicating at the precise
rate that the particles in my swf are being generated.



Cyberfish wrote:
> 
> I've read literally every post in here about this, and none directly
> relate or shed any light on my issue. I am trying to map an external SWF
> of a particle loop to a plane for a background.  I managed to load the swf
> into a movieclip instance.  I created the variables for my material and
> for my plane.  The material is set to interactive.  When I attempt to run
> the code it throws an error:
> 
> TypeError: Error #1009: Cannot access a property or method of a null
> object reference.
> 	at org.papervision3d.materials::MovieMaterial/updateBeforeRender()
> 	at
> org.papervision3d.core.render.material::MaterialManager/updateMaterialsBeforeRender()
> 	at
> org.papervision3d.render::BasicRenderEngine/org.papervision3d.render:BasicRenderEngine::doRender()
> 	at org.papervision3d.render::BasicRenderEngine/renderScene()
> 	at spike2_fla::MainTimeline/loop()
> 
> 
> 
> 
> I am curious to know what I am missing as far as code or whatever.  Did I
> skip a step?  Does something have to be done between loading the swf and
> passing the movieclip to the material object? Strangely if I comment out
> the plane var, and the moviematerial var and test the movie, the swf plays
> on stage. I am guessing the disconnect is somwhere between loading and
> passin the movieclip var into the moviematerial.  Im using pv3d 2.0 great
> white and FlashCS3 (actions not editor).  Thanks in advance The code is
> below:
> 
> 
> import org.papervision3d.scenes.*;
> import org.papervision3d.cameras.*;
> import org.papervision3d.objects.*;
> import org.papervision3d.objects.special.*;
> import org.papervision3d.objects.primitives.*;
> import org.papervision3d.materials.*;
> import org.papervision3d.materials.special.*;
> import org.papervision3d.materials.shaders.*;
> import org.papervision3d.materials.utils.*;
> import org.papervision3d.lights.*;
> import org.papervision3d.render.*;
> import org.papervision3d.view.*;
> import org.papervision3d.events.*;
> import org.papervision3d.core.utils.*;
> import org.papervision3d.core.utils.virtualmouse.VirtualMouse;
> import caurina.transitions.*;
> import org.papervision3d.events.InteractiveScene3DEvent;
> import flash.net.URLRequest;
> import flash.display.Loader;
> 
> var viewport:Viewport3D = new Viewport3D(0, 0, true, true);
> addChild(viewport);
> viewport.interactive = true;
> 
> var renderer:BasicRenderEngine = new BasicRenderEngine();
> 
> var scene = new Scene3D();
> 
> var camera:Camera3D = new Camera3D();
> camera.zoom = 10;
> camera.focus = 100;
> 
> 
> var material:MovieMaterial = new MovieMaterial(thisMovieClip);
> material.animated = true;
> material.smooth = true;
> 
> 
> 
> var p:Plane = new Plane(material, 1200, 950, 3, 3);
> scene.addChild(p);
>    
> 
> 
> 
> 
> var thisMovieClip:MovieClip;
> 
> var thisLoader:Loader = new Loader();
> 
> thisLoader.contentLoaderInfo.addEventListener(Event.INIT, doneLoading);
> 
> thisLoader.load( new URLRequest("gumdrop.swf") );
> 
> function doneLoading(evt:Event):void {
> 
> thisMovieClip = MovieClip(thisLoader.content);
> 
> addChild(thisMovieClip);
> //thisMovieClip.addchild(thisLoader.content);
> thisMovieClip.stop();
> 
> }
> 

-- 
View this message in context: http://www.nabble.com/Not-Just-Another-MovieMaterial-Question-HEEEELPP%21-tp17544434p17545266.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list