# Flartoolkit

**URL:** <https://forum.kirupa.com/t/flartoolkit/312406>\
**Category:** Uncategorized\
**Created:** [August 2, 2010, 6:50pm UTC](https://forum.kirupa.com/t/flartoolkit/312406 "2010-08-02T18:50:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![surf](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@surf](https://forum.kirupa.com/u/surf)\
**Post date:** [August 2, 2010, 6:50pm UTC](https://forum.kirupa.com/t/flartoolkit/312406/1 "2010-08-02T18:50:14Z")

</div>

hi,  
i can make this code work when running as a flash application, but when its packaged and installed as AIR application, all i can see is blank image. The camera light does go on but there is no sign of camera on stage.  
please help… even advice would be awsome  
here is the code for my application  
this is the same simple code you can find on lee brimelows augmented reality tutorial… just that the video is replaced wiv a basic plane…

```auto

public class Main extends Sprite
    {
        private var nativeWindow : NativeWindow;
        private var nativeInOp : NativeWindowInitOptions;
        private var fm : FLARManager;
        private var scene : Scene3D;
        private var view : Viewport3D;
        private var camera : FLARCamera3D;
        private var lre : LazyRenderEngine;
        private var p : Plane;
        private var con : DisplayObject3D;
        private var marker : FLARMarker;

        public function Main() 
        {
            var mon : MonsterDebugger = new MonsterDebugger(this);
            stage.scaleMode = StageScaleMode.NO_SCALE;
            stage.align = StageAlign.TOP;
            
            nativeInOp = new NativeWindowInitOptions();
            nativeInOp.maximizable = true;
            nativeInOp.resizable = true;
            nativeWindow = new NativeWindow(nativeInOp);
            nativeWindow.x = (Capabilities.screenResolutionX - nativeWindow.width) / 2;
            nativeWindow.y = (Capabilities.screenResolutionY - nativeWindow.height) / 2;
            
            addEventListener(Event.ADDED_TO_STAGE, init);
        }

        private function init(e : Event) : void 
        {
            removeEventListener(Event.ADDED_TO_STAGE, init);
            
            initFLAR();
        }

        private function initFLAR() : void 
        {
            try
            {
                fm = new FLARManager("flarz/flarConfig.xml");
                fm.addEventListener(FLARMarkerEvent.MARKER_ADDED, onAdded);
                fm.addEventListener(FLARMarkerEvent.MARKER_REMOVED, onRemoved);
                fm.addEventListener(Event.INIT, init3D);
                addChild(Sprite(fm.flarSource));
            }
            catch(err : FLARException)
            {
                trc(err.message);
            }
        }

        private function onAdded(e : FLARMarkerEvent) : void
        {
            marker = e.marker;
        }

        private function onRemoved(e : FLARMarkerEvent) : void
        {
            marker = null;
        }

        private function init3D(e : Event) : void
        {
            scene = new Scene3D();
            camera = new FLARCamera3D(fm.cameraParams);
            camera.z = -30;
            view = new Viewport3D(640, 480, true);
            lre = new LazyRenderEngine(scene, camera, view);
            
            
            p = new Plane(new ColorMaterial(0xffeeff), 320, 240, 2, 2);
            p.scaleY = -1;
            p.rotationZ = 90;
            p.visible = false;
            
            con = new DisplayObject3D();
            con.addChild(p);
            
            scene.addChild(con);
            addChild(view);
            addChild(new FramerateDisplay());
            
            addEventListener(Event.ENTER_FRAME, loop);
        }

        private function loop(e : Event) : void
        {
            if(marker != null)
            {
                con.transform = FLARPVGeomUtils.convertFLARMatrixToPVMatrix(marker.transformMatrix);
            }
            lre.render();
        }

        private function trc(arg : *) : void
        {
            MonsterDebugger.trace(this, arg);
        }

```
