take off the () after macaco1, it should read

view.addChild (macaco1);

It was looking for a function called macaco1(), not the object
macaco1. Its a subtle, but critical difference.

BTW, what's a macaco? Its a fun word to say.


On Jan 27, 12:18 pm, Kran <[email protected]> wrote:
> Hi,
> I need import the macaco.as (3d object exported of Blender 3d) in a
> scene, but anithing do error. thise is the code:
> ----------------------------------------------------------
> // import containers library
> import away3d.containers.*;
> // import core library
> import away3d.core.base.*;
> // import geometry primitives
> import away3d.primitives.*;
> //import math objects
> import away3d.core.math.*;
> //import a macaco.as
> import macaco;
>
> // create a 3D-viewport
> var view:View3D = new View3D({x:300, y:200});
> // add viewport to the stage
> addChild(view);
>
> // create a macaco
> var macaco1:macaco=new macaco();
> view.addChild (macaco1()); //ERROR is hire
>
> // point camera at the sphere
> view.camera.position = new Number3D(1000, 1000, 1000);
> view.camera.lookAt(macaco1.position);
>
> // every frame
> addEventListener(Event.ENTER_FRAME, onEnterFrame);
> function onEnterFrame(event:Event):void {
>         // rotate sphere around the Y-axis
>         macaco1.rotationY = getTimer() / 100;
>         // rerender viewport on each frame
>         view.render();}
>
> ----------------------------------------------------------------------
> ERROR:1180: Call to a possibly undefined method macaco1.
>
> I'm use flash cs3 and the macaco.as is in diretory os teste.fla
>
> tks!!!
> Away will be the  future of web!!!:)

Reply via email to