[Papervision3D] Error 1009, help
Gaurav Khanna
gauravk92 at gmail.com
Wed Jun 13 00:03:44 EDT 2007
o wow it worked, genius WOOT, except it only made one car, sigh lemme see
why it didnt do the second
On 6/13/07, Peter Kapelyan <flashnine at gmail.com> wrote:
>
> lol Collin you just pasted the focus example :) I give up :)
>
> On 6/12/07, Collin Cusce <rafajafar at gmail.com> wrote:
> >
> > It must be defined and initialized. So you say, "This is a Scene3D" and
> > then you initialize it like, "This is a particular Scene3D"
> >
> > so for you, you need to make your movie by going
> > rootNode = new Sprite();
> > rootNode.x = 400;
> > rootNode.y = 400;
> > addChild(rootNode);
> > scene = new Scene3D( rootNode );
> >
> > On 6/12/07, Gaurav Khanna <gauravk92 at gmail.com > wrote:
> > >
> > > scene is already defined
> > > private var scene:Scene3D;
> > > should i change it to that?
> > >
> > > On 6/12/07, Collin Cusce < rafajafar at gmail.com > wrote:
> > > >
> > > > you're doing this right,
> > > > addChild(container);
> > > > scene = new MovieScene3D( container );
> > > >
> > > > On 6/12/07, Gaurav Khanna < gauravk92 at gmail.com > wrote:
> > > > >
> > > > > if i do scene it throws this error, same as if i took out this but
> > > > > a little different
> > > > > ReferenceError: Error #1069: Property rootNode not found on
> > > > > org.papervision3d.scenes.Scene3D and there is no default value.
> > > > > at main/::loop3D()
> > > > >
> > > > > also tried stage and it gave sort of the same thing except it was
> > > > > for flash.display.stage, its ok though, those two errors arent
> > > > > cause by whats in the parentheses and quotes at the end cause i'm not sure
> > > > > if i have those right and i think thats the problem, i already tried Focus
> > > > > and raceCar1 which are the probable things, and just tried out Car1 and that
> > > > > didn't work either ughh lemme see what else i can do
> > > > >
> > > > >
> > > > > On 6/12/07, Peter Kapelyan < flashnine at gmail.com > wrote:
> > > > > >
> > > > > > Sorry - I don't remeber the last time I used "this" for anything
> > > > > > I believe I always used something like:
> > > > > >
> > > > > > var car :DisplayObject3D = *scene*.rootNode.getChildByName(
> > > > > > "Focus" );
> > > > > >
> > > > > > but hey I could be wrong again - never hurts to try :)
> > > > > > -Pete
> > > > > >
> > > > > >
> > > > > > On 6/12/07, Gaurav Khanna <gauravk92 at gmail.com > wrote:
> > > > > > >
> > > > > > > rootNode exists...i think
> > > > > > >
> > > > > > > private var rootNode:DisplayObject3D;
> > > > > > >
> > > > > > > peter, i posted in my last reply that i took out the this and
> > > > > > > then it threw some error about not being allowed to execute it or something,
> > > > > > > gah why are the errors so vague in as3
> > > > > > > umm the car is an object not a container, at least i think so,
> > > > > > > i dont fully understand what your talking about with the container so i
> > > > > > > might be wrong
> > > > > > >
> > > > > > >
> > > > > > > On 6/12/07, Peter Kapelyan <flashnine at gmail.com > wrote:
> > > > > > > >
> > > > > > > > Maybe try to delete "this"...?
> > > > > > > > also can try naming a container with container.name - Stefan
> > > > > > > > posted a way like this:
> > > > > > > > cube.container.name = ("Cube" + String( num ) );
> > > > > > > >
> > > > > > > > hope it helps
> > > > > > > > -Pete
> > > > > > > >
> > > > > > > > On 6/12/07, Gaurav Khanna <gauravk92 at gmail.com > wrote:
> > > > > > > > >
> > > > > > > > > Thanks for your quick reply, should've thought of that
> > > > > > > > > myself but i figured it out, var car1 and var car2 defined in loop3D are
> > > > > > > > > null, and i cant figure out how to make them ..umm unnull, in the old code
> > > > > > > > > the line was like this
> > > > > > > > >
> > > > > > > > > var car :DisplayObject3D = this.rootNode.getChildByName(
> > > > > > > > > "Focus" );
> > > > > > > > >
> > > > > > > > > so i tried these and they didnt work one way or another
> > > > > > > > >
> > > > > > > > > var car1 :DisplayObject3D =
> > > > > > > > > this.rootNode.Focus.getChildByName( "raceCar1" );
> > > > > > > > > var car1 :DisplayObject3D = this.rootNode.getChildByName(
> > > > > > > > > "raceCar1" );
> > > > > > > > > var car1 :DisplayObject3D = rootNode.getChildByName(
> > > > > > > > > "Focus" );
> > > > > > > > >
> > > > > > > > > i can post more code if need be
> > > > > > > > >
> > > > > > > > > On 6/12/07, Collin Cusce <rafajafar at gmail.com > wrote:
> > > > > > > > > >
> > > > > > > > > > Trace your variables with the trace function, find out
> > > > > > > > > > which one is null, figure out why it's null. If you still have questions,
> > > > > > > > > > ask again. I dont see anything there that would return null based only on
> > > > > > > > > > your code. It's probably something mispelled earlier in the program or
> > > > > > > > > > something that you sent a wrong value to.
> > > > > > > > > >
> > > > > > > > > > On 6/12/07, Gaurav Khanna < gauravk92 at gmail.com > wrote:
> > > > > > > > > >
> > > > > > > > > > > I've been working with the Focus example to try and
> > > > > > > > > > > get two cars in there, and i've learned a lot about pv3d as i am a newbie,
> > > > > > > > > > > but i keep getting this really vague error no matter what i do.
> > > > > > > > > > >
> > > > > > > > > > > TypeError: Error #1009: Cannot access a property or
> > > > > > > > > > > method of a null object reference.
> > > > > > > > > > > at main/::loop3D()
> > > > > > > > > > >
> > > > > > > > > > > Heres the loop3D() that its referring too
> > > > > > > > > > >
> > > > > > > > > > > private function loop3D(event:Event):void {
> > > > > > > > > > > camera.z=-300 + scene.container.mouseX * 10;
> > > > > > > > > > > camera.y=Math.max(0,this.mouseY) * 5;
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > // Get plane from rootNode
> > > > > > > > > > > var Car1:DisplayObject3D=this.rootNode.getChildByName
> > > > > > > > > > > ("raceCar1");
> > > > > > > > > > > var Car2:DisplayObject3D=this.rootNode.getChildByName
> > > > > > > > > > > ("raceCar2");
> > > > > > > > > > >
> > > > > > > > > > > // Check if car has been loaded
> > > > > > > > > > > if (Car1) {
> > > > > > > > > > > // Get plane from rootNode, we obviously don't need to
> > > > > > > > > > > check if it has been loaded.
> > > > > > > > > > > var plane:DisplayObject3D=this.rootNode.getChildByName
> > > > > > > > > > > ("Plane");
> > > > > > > > > > > }
> > > > > > > > > > > // Check if car hits plane and change color
> > > > > > > > > > > if (Car1.hitTestObject(plane)) {
> > > > > > > > > > > plane.material.fillColor=0xFFFFFF;
> > > > > > > > > > > } else {
> > > > > > > > > > > plane.material.fillColor=0x333333;
> > > > > > > > > > > }
> > > > > > > > > > > if (Car2.hitTestObject(plane)) {
> > > > > > > > > > > plane.material.fillColor=0xFFFFFF ;
> > > > > > > > > > > } else {
> > > > > > > > > > > plane.material.fillColor=0x333333 ;
> > > > > > > > > > > }
> > > > > > > > > > > // Calculate current steer and speed
> > > > > > > > > > > driveCar1();
> > > > > > > > > > > driveCar2();
> > > > > > > > > > >
> > > > > > > > > > > // Update car model
> > > > > > > > > > > updateRaceCar1(Car1);
> > > > > > > > > > > updateRaceCar2(Car2);
> > > > > > > > > > > // Render the scene
> > > > > > > > > > > this.scene.renderCamera(camera);
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > > On a side note i am having problems working with the
> > > > > > > > > > > heirarchy of the moodels, in maya i made it so that everything is under
> > > > > > > > > > > Focus group, in that theres a raceCar1 and raceCar2 group, so i'm not sure
> > > > > > > > > > > if i did this correctly
> > > > > > > > > > >
> > > > > > > > > > > private function
> > > > > > > > > > > updateRaceCar1(Car1:DisplayObject3D):void {
> > > > > > > > > > > //Get raceCar Materials
> > > > > > > > > > > //var raceCar1:DisplayObject3D=Car1.getChildByName
> > > > > > > > > > > ("raceCar1");
> > > > > > > > > > >
> > > > > > > > > > > // Steer front wheels
> > > > > > > > > > > var steerFR1:DisplayObject3D= Car1.getChildByName
> > > > > > > > > > > ("Steer_FR1");
> > > > > > > > > > > var steerFL1:DisplayObject3D=Car1.getChildByName
> > > > > > > > > > > ("Steer_FL1");
> > > > > > > > > > >
> > > > > > > > > > > steerFR1.rotationY=steer;
> > > > > > > > > > > steerFL1.rotationY=steer;
> > > > > > > > > > >
> > > > > > > > > > > // Rotate wheels
> > > > > > > > > > > var wheelFR1:DisplayObject3D= steerFR1.getChildByName
> > > > > > > > > > > ("Wheel_FR1");
> > > > > > > > > > > var wheelFL1:DisplayObject3D=steerFL1.getChildByName
> > > > > > > > > > > ("Wheel_FL1");
> > > > > > > > > > > var wheelRR1:DisplayObject3D=Car1.getChildByName("Wheel_RR1");
> > > > > > > > > > >
> > > > > > > > > > > var wheelRL1:DisplayObject3D= Car1.getChildByName
> > > > > > > > > > > ("Wheel_RL1");
> > > > > > > > > > >
> > > > > > > > > > > var roll:Number=speed / 2;
> > > > > > > > > > > wheelFR1.roll(roll);
> > > > > > > > > > > wheelRR1.roll(roll);
> > > > > > > > > > > wheelFL1.roll(- roll);
> > > > > > > > > > > wheelRL1.roll(- roll);
> > > > > > > > > > >
> > > > > > > > > > > // Steer car
> > > > > > > > > > > Car1.yaw(speed * steer / 500);
> > > > > > > > > > >
> > > > > > > > > > > // Move car
> > > > > > > > > > > Car1.moveForward(speed);
> > > > > > > > > > > }
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > Everything in there is the same except switch #1 to
> > > > > > > > > > > #2, i think i got it right but i'm not postive because there could be an
> > > > > > > > > > > error there too, anyway any help is appreciated
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > _______________________________________________
> > > > > > > > > > > Papervision3D mailing list
> > > > > > > > > > > Papervision3D at osflash.org
> > > > > > > > > > >
> > > > > > > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > _______________________________________________
> > > > > > > > > > Papervision3D mailing list
> > > > > > > > > > Papervision3D at osflash.org
> > > > > > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > _______________________________________________
> > > > > > > > > Papervision3D mailing list
> > > > > > > > > Papervision3D at osflash.org
> > > > > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > > > _______________________________________________
> > > > > > > > Papervision3D mailing list
> > > > > > > > Papervision3D at osflash.org
> > > > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > > > _______________________________________________
> > > > > > > Papervision3D mailing list
> > > > > > > Papervision3D at osflash.org
> > > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > > >
> > > > > > >
> > > > > >
> > > > > > _______________________________________________
> > > > > > Papervision3D mailing list
> > > > > > Papervision3D at osflash.org
> > > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > > >
> > > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Papervision3D mailing list
> > > > > Papervision3D at osflash.org
> > > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > >
> > > > >
> > > >
> > > > _______________________________________________
> > > > Papervision3D mailing list
> > > > Papervision3D at osflash.org
> > > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > >
> > > >
> > >
> > > _______________________________________________
> > > Papervision3D mailing list
> > > Papervision3D at osflash.org
> > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > >
> > >
> >
> > _______________________________________________
> > Papervision3D mailing list
> > Papervision3D at osflash.org
> > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> >
> >
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20070613/0a4f547c/attachment-0001.htm
More information about the Papervision3D
mailing list