Then I'm trying to set up a background.  For the moment, just adding a
sphere as a test.  Passing my view component to this controller:

package com.netaporter.napLive.control
{
        import away3d.materials.ColorMaterial;
        import away3d.primitives.Sphere;

        import com.netaporter.napLive.displayObjects.NapBackground;
        import com.netaporter.napLive.views.NapliveView;

        import flash.events.EventDispatcher;

        public class BackgroundControl extends ANapLiveControl
        {
                private var bg:NapBackground;
                public function BackgroundControl(_viewCom:NapliveView,
_dispatcher:EventDispatcher)
                {
                        super(_viewCom, _dispatcher);
                }

                override protected function initDisplayObjects():void {
                        bg = new NapBackground();
                        var test:Sphere= new Sphere(new 
ColorMaterial(0xffffff,1));
                        this.view.mainContainer.addChild(test);
                }
        }
}

On Apr 7, 1:32 pm, kyma <[email protected]> wrote:
> :-) Yep sorry, that was a desperate plea for help and not very useful.
> My view component:
>
> package com.netaporter.napLive.views
> {
>
>         import away3d.cameras.Camera3D;
>         import away3d.containers.Scene3D;
>         import away3d.containers.View3D;
>         import away3d.core.render.DefaultRenderer;
>         import away3d.materials.ColorMaterial;
>         import away3d.materials.WireframeMaterial;
>         import away3d.primitives.Sphere;
>
>         import flash.events.Event;
>
>         import mx.core.UIComponent;
>
>         public class AwayView extends UIComponent
>         {
>                 public var view:View3D
>                 public var _scene:Scene3D = new Scene3D();
>                 private var _camera:Camera3D = new Camera3D();
>
>                 protected var viewWidth:Number;
>                 protected var viewHeight:Number;
>
>                 public function AwayView()
>                 {
>                         view = new View3D(_scene,_camera);
>                         super();
>                 }
>
>                 public function 
> setDimensions(_width:Number,_height:Number):void {
>                         viewWidth = _width;
>                         viewHeight = _height;
>                         update();
>                 }
>
>                 public function set camera(cam:Camera3D):void {
>                         this.view.camera = cam;
>                 }
>
>                 public function get camera():Camera3D {
>                         return this.view.camera;
>                 }
>
>                 override protected function createChildren():void
>                 {
>                         super.createChildren();
>                         this.addChild( view );
>                         view.addEventListener(Event.ADDED_TO_STAGE, update);
>                 }
>
>                 override protected function 
> updateDisplayList(unscaledWidth:Number,
> unscaledHeight:Number):void
>                 {
>                         super.updateDisplayList(unscaledWidth, 
> unscaledHeight);
>                         update();
>                 }
>
>                 private function update(e:* = null):void
>                 {
>                         if(view.stage){
>                                 view.x = viewWidth/2;
>                                 view.y = viewHeight/2;
>                                 view.render();
>                                 
> view.addEventListener(Event.ENTER_FRAME,enterFrameHandler);
>                         }
>                 }
>
>                 private function enterFrameHandler(e:Event):void {
>                         view.render();
>
>                 }
>         }
>
> }
>
> On Apr 7, 12:44 pm, John Brookes <[email protected]> wrote:
>
>
>
>
>
>
>
> > Unless this is some guessing game.
>
> > Tip 1
> > post the code

Reply via email to