lights are no longer extending object3d in 3.5
use addLight(); instead

Fabrice



On Jun 2, 2010, at 5:09 PM, jens lofberg wrote:

> I have a very strange problem. When I run the code below I get this error:
> 1067: Implicit coercion of a value of type away3d.lights:DirectionalLight3D 
> to an unrelated type away3d.core.base:Object3D.
> 
> If I remove this line everything works (but no light):
> _view.scene.addChild(_light);
> 
> Any idea could be helpful...
> thanks / jens
> 
> package {
>    import away3d.containers.Scene3D;
>    import flash.display.Sprite
>    import flash.display.BitmapData
>    import flash.geom.Matrix;
>    import flash.geom.Point;
>    import cube.events.InfoEvent;
>    import flash.display.DisplayObjectContainer
>    import away3d.cameras.Camera3D
>    import away3d.containers.View3D;
>    import away3d.core.math.Number3D;
>    import away3d.primitives.Cube;
>    import away3d.containers.ObjectContainer3D
>    import away3d.lights.DirectionalLight3D;
> 
>    public class TreeDBase extends Sprite {
>        public var _items3D = new ObjectContainer3D()
>        public var _cam:Camera3D
>        public var _view:View3D
>        public var _light:DirectionalLight3D
> 
>        public function TreeDBase () {
>        }
>        public function setup3D():void {
>            _cam = new Camera3D( { zoom:6, focus:400 } )
>            _view = new View3D( {x:0, y:0, camera:_cam, stats:true } );
>            _items3D = new ObjectContainer3D()
>            _view.scene.addChild(_items3D);
>            addChild (_view);
>            _light = new DirectionalLight3D();
>            _view.scene.addChild(_light);
>        }
>        public function remove3D():void {
>            removeChild (_view);
>        }
>        public function update3D():void {
>            _view.render();
>        }
>    }
> }

Reply via email to