Flex and Augmented Reality, Preview not working

Hi
I have been following the tutorial  Introduction to Augmented Reality on gotoandlearn(http://www.gotoandlearn.com/play.php?id=105).
I have followed the coding exactly  and yet nothing happens when I go to preview it.  I have even copied the  code in the provided code (ar.zip) into my project and have had no result.  When I go  to run the application inside Flex, the Flash Player opens with the  default Flex coluring but nothing occurs inside, Eg the camera is not  called up etc.
I am using FlexBuilder 3 with Flex 3.5.  With  Flash Player 9.
Here is the code (basically pulled straight  from the downloadables)
package {
   import flash.display.BitmapData;
   import  flash.display.Sprite;
   import flash.events.Event;
   import  flash.media.Camera;
   import flash.media.Video;
   import  flash.utils.ByteArray;
   import  org.libspark.flartoolkit.core.FLARCode;
   import  org.libspark.flartoolkit.core.param.FLARParam;
   import  org.libspark.flartoolkit.core.transmat.FLARTransMatResult;
   import  org.libspark.flartoolkit.detector.FLARSingleMarkerDetector;
   import  org.libspark.flartoolkit.pv3d.FLARBaseNode;
   import  org.libspark.flartoolkit.pv3d.FLARCamera3D;
   import  org.papervision3d.lights.PointLight3D;
   import  org.papervision3d.materials.utils.MaterialsList;
   import  org.papervision3d.objects.primitives.Cube;
   import  org.papervision3d.render.BasicRenderEngine;
   import  org.papervision3d.scenes.Scene3D;
   import  org.papervision3d.view.Viewport3D;
   [SWF(width="640".  height="480". frameRate="30". backgroundColor="#FFFFFF")]
    public class ARTester extends Sprite
       [Embed(source="map.pat". mimeType="application/octet-stream")]
       private var pattern:Class;
       [Embed(source="camera_para.dat". mimeType="application/octet-stream")]
       private var params:Class;
      private var  fparams:FLARParam;
      private var mpattern:FLARCode;
       private var vid:Video;
      private var cam:Camera;
       private var bmd:BitmapData;
      private var raster:  FLARRgbRaster_BitmapData;
      private var  detector:FLARSingleMarkerDetector;
      private var scene:Scene3D;
       private var camera:FLARCamera3D;
      private var  container:FLARBaseNode;
      private var vp:Viewport3D;
       private var bre:BasicRenderEngine;
      private var  trans:FLARTransMatResult;
      public function  ARTester()
         setupFLAR();
          setupCamera();
         setupBitmap();
         setupPV3D();
          addEventListener(Event,ENTER_NAME, loop);
          private function setupFLAR():void
             fparams = new FLARParam();
            fparams.loadARParam(new  params() as ByteArray);
            mpattern = new FLARCode(16, 16);
             mpattern.loadARPatt(new pattern());
   private  function setupCamera():void
      vid = new Video(640, 480);
       cam = Camera.getCamera();
      cam.setMode(640, 480, 30);
       vid.attachCamera(cam);
      addChild(vid);
        private function setupBitmap():void
          bmd =  new BitmapData(640, 480);
          bmd.draw(vid);
           raster = new FLARRgbRaster_BitmapData(bmd);
          detector = new  FLARSingleMarkerDetector(fparams, mpattern, 80);
        private function setupPV3D():void
          scene = new  Scene3D();
          camera = new FLARCamera3D(fparams);
           container = new FLARBaseNode();
          scene.addChild(container);
          var pl:PointLight3D = new PointLight3D();
           pl.x = 1000;
          pl.y = 1000;
          pl.z = -1000;
          var ml:MaterialsList = new MaterialList({all:  FlatShadeMaterial(pl)});
          var cube1:Cube = new  Cube(ml, 30, 30, 30);
          var cube2:Cube = new Cube(ml, 30,  30, 30);
          cube2.z = 50
          var cube3:Cube = new  Cube(ml, 30, 30, 30);
          cube3.z = 100;
           container.addChild(cube1);
          container.addChild(cube2);
           container.addChild(cube3);
          bre = new  BasicRenderEngine();
          trans = new FLARTransMatResult();
          vp = new Viewport3D();
           addChild(vp);  
       private function  loop(e:Event):void
              bmd.draw(vid);
             try
                 if(detector.detectMarkerLite(raster. 80) &&  detector.getConfidence() > 0.5)
                 detector.getTransformMatrix(trans);
                 container.setTransformMatrix(trans);
                 bre.renderScene(scene, camera, vp);
        catch(e:Error){}
Any help would be much appreiciated.
Thanks
Daniel.
Also; sorry I wasn't sure how to neatly display my code in the post

You didn't post the original, before adding the +5 exposure.
I played around in LR5 with some of my photos, and I found this one that exhibits similar results on adding +5 exposure, but it starts off as underexposed and low contrast.  Anything a bit more exposed or with a slightly brighter area (e.g. make dog's front leg a tiny bit brighter) does clip.  (Note - this is the original photo without adding any exposure).

Similar Messages

  • Zoom not working and fullscreen image preview not working. !

    I have updated the latest mountain lion. After this i am not able to zoom in using the control key and two finger upside slide on trackpad and also the image preview which before i could see fullscreen by spreading out two fingers is not working now. Please help me up with this issue if anyone possibly could as i have adapted these features in my designing life.
    Thank You.

    Mine is even weirder, but maybe I can help.
    First, a number of people are reporting that the zoom feature seems to stop working after the computer goes to sleep.  You get it back if you reboot.  However, a simpler solution is that you can move the cursor to a screen corner - one you have set up to start a screen saver - and when you move the cursor away to stop the screen saver, the zoom works again.  Still a bug, but fairly easy to deal with until your computer goes to sleep again.
    Mine is really weird because, as I was working to try to get zoom to work before finding out this other stuff, somehow I ended up with a situation where if I turn on zoom, the screen instantly zooms and I can't get it to unzoom except by turning off zoom.  However, even though zoom is then turned off, I can zoom the screen as if it is on!
    So, besides trying the trick of activating the screen saver, you might try turning off zoom and see if it will still zoom.

  • Highlight and shadow clipping preview not working in LR5

    There's a gap between the edge of my tonal information and the end of the histogram box on both sides of the graph. No matter how bright or dark I make the image it does not show clipping and the values do not slide to the far edges of the box like they used to. Also, holding down option when dragging the 'whites' and 'blacks' sliders no longer shows me clipped values no matter how bright or dark I make it. Ugh....I use these features all the time and feel blind without them.

    You didn't post the original, before adding the +5 exposure.
    I played around in LR5 with some of my photos, and I found this one that exhibits similar results on adding +5 exposure, but it starts off as underexposed and low contrast.  Anything a bit more exposed or with a slightly brighter area (e.g. make dog's front leg a tiny bit brighter) does clip.  (Note - this is the original photo without adding any exposure).

  • Preview not working in 10.6

    Preview not working in 10.6. Not able to open multiple JPG files. No problem in 10.5.7.
    Any solution?

    I've been following this thread and several others about this same issue with interest. Today I went to Astronomy Picture of the Day to take a look at the pix for August and downloaded eight of them. Whether it matters or not, I made a folder on my Desktop, then dragged the full picture from its "picture only" page into the folder. After I finished I opened the folder, did Command-A and double clicked the group. All eight opened in Preview and I used the down arrow to move from one to the next.
    I did an upgrade install of Snow Leopard on a VERY clean install of Leopard (pretty much no third party anything had been added, certainly no haxies, Contextual Menu items, Input Managers, menu bar extras, and only a limited number of third party applications).
    So unfortunately it looks like I can't investigate this issue since I can't reproduce it. Haven't seen anything in the discussions of the issue so far that lead me any theory about why some people have it and some, including me, don't.
    Francine
    Francine
    Schwieder

  • Canon file RAW CR2 and mac book pro not working ...?

    Canon file RAW CR2 and mac book pro not working ...?
    I'm using Digital photo professional software
    and i'm using canon camer 5D mark2 and mac book pro 13inch last version
    i'm trying to shooting directly by Digital photo professional, Remote shooting but the RAW file con't open by the software or mac preview but with photoshop Cs5 can open
    is any one have the same issu ? and how fix it please
    What i did :
    - update camera RAW
    - Update Mac software
    - update Digital photo professional
    Regards,,
    Bandar

    Dear all
    is there any solution  for that ?

  • Preview not working!!! Blank document appears!

    My Preview stopped working! I downloaded a few PDF documents, thinking that Preview would automatically launch and open the files. Preview did launch, however, all I saw were blank white documents, nothing on them.
    Next thing I did was open my Adobe Reader application and tried to read the PDF documents. Yes, it worked. I was able to see the documents.
    But why is Preview not working correctly? What is happening?

    Hi, Makiko. The version of Preview that came with Panther is old, and some of the features that newer PDF-creation software can build into PDF files may not be supported by it. In other words, your Preview application became static several years ago, while the PDF file format has continued to evolve. Your Preview can probably still open all the other file formats that it opened when it was new, but you may want to set things up so that all PDF files are handled by Adobe Reader instead. To do that, click once on any PDF file in the Finder and choose Get Info from the File menu. In the "Open with" section of the Get Info window, choose Adobe Reader from the drop-down menu, then click the Change All button. Close the Get Info window. Now all PDFs that you double-click will open in Adobe Reader.
    Note that at present, the latest version of Adobe Reader that works in Panther is 7.1.0. If you have an earlier version, you may want to update it.

  • I updated my iPad 4 iOS 8.0.2 and the camera does not work, ... Please help

    I updated my iPad 4 iOS 8.0.2 and the camera does not work and hangs and unconnected, .... Please help me in this question,... Thanks in advance

    You're welcome, but I didn't do anything. Try closing the camera app completely and reset your iPad and maybe that will help.
    In order to close apps, you have to drag the app up from the multitasking display. Double tap the home button and you will see apps lined up going left to right across the screen. Swipe to get to the app that you want to close and then swipe "up" on the app preview thumbnail to close it.
    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Preview Not Working - pls helpp..

    Hi there,
    I'm running Lion on my Macbook Pro and have a problem with Preview not working.
    It seems to have almost jammed and has a document that I don't think I even have anymore in it's title bar.
    The timeout / loading wheels continues to spin and I have to Force Quit.
    I have tried deleting the com.apple.Preview.plist - but this hasn't done anything.
    Any ideas & help greatly appreciated.

    To add to this. When I open it (preview) the file that it looks like it's opening is titled 'ai.icns'. I've got no idea what this was but have seen that it's a large graphics folder. I very possibly clicked on it whilst doing some work the other day and went to shut it down quickly and now it looks like it's in a state of opening-up but without actually getting anywhere..

  • Thanks for responding.  Since I upgraded ITUNES to IOS 6, my IPOD Touch no longer works at all.  I had numerous apps, music and videos on this touch.  It made me restore to factory reset and it still does not work!!! Nothing I do will work on this touch n

    Thanks for responding. Since I upgraded ITUNES to IOS 6, my IPOD Touch no longer works at all. I had numerous apps, music and videos on this touch. It made me restore to factory reset and it still does not work!!! Nothing I do will work on this touch now. I have so much data on this, I don't want to loose or have to restore!
    Can you help me?
    Thanks

    If you restored to factory settings/new iPod and still have the problem that indicates a hardware problem.
    Make an appointment at the Genius Bar of an Apple store..
    Apple Retail Store - Genius Bar

  • TA44551 My 1-year ipod nano locked up and would not start overnight. The on/off button will not work and stopped holding charge. No water damage, no fall, nothing unusual. I restored it (twice) but it will still not hold charge and on/off does not work.

    My 1-year ipod nano locked up and would not start overnight. The on/off button will not work and stopped holding charge. No water damage, no fall, nothing unusual. I restored it (twice) but it will still not hold charge and on/off does not work. I tried to restore it again and charged it in three different locations with different cables. etc but nothing. Suggestions?

    - After charging for 1/2 hour or so, does iTunes see the iPod?  If yes, restore the iPod from backup.
    - If no, se if placing the iPod in recovery mode will make it visible so you can restore the iPod.  For recovery mode see:
    iPhone and iPod touch: Unable to update or restore

  • HDMI and PC inputs do not work on my 37AV502R LCD TV

    HDMI inputs and PC inputs do not work consistently
    my Apple TV (HDMI) and computers 2 on HDMI, 1 on PC, display just fine n the TV but after a while the TV goes blank,
    the time is not consistent sometime a few minutes, sometimes a few hours,
    but every time, after the TV goes blank there is nothing I can do, the TV just stays blank, if I unplug and turn back on the TV displays the image for a split second and goes bank again,
    I thought it might be an overheating thing, however sometimes the PC input will stop working but the HDMI input (either one) will work fine,
    has anyone else had this issue?
    Thanks
    A. 

    I'm having the same issue.  As soon as I connect it to VGA or HDMI, it goes into a cycle of flashing on-and-off.  A guy on youtube had the same problem (posted a video identical to my problem) and reportedly fixed it with a firmware update.  
    The problem: the US website doesn't have a firmware download.  The canadian website does, but the update is from 4/2009, and the manufactured date on the back of my TV is 5/2009.  (I also tried the update, but it didn't fix the problem).
    When I call Toshiba to ask about the firmware update, after they confirm I am out of warranty, their automated system keeps hanging up on me.  So frustrating. 

  • How to delete video from iTunes library? del and shift+del are not working - no any reaction

    how to delete video from iTunes library? del and shift+del are not working - no any reaction.

    seb963 wrote:
    Hi
    Currently, iMatch is turned off on my computer, as I do not want to upload any more songs. If I turn it on, will it upload all songs that are currently in my library? Is there another way that deleting them one by one?
    You must enable iTunes Match on the new computer. The best way to accomplish what you want to do is to create a new, empty library by launching iTunes while holding down the Option key (Shift on Windows) and choosing "new library." Do not let iTunes scan for new content, but do enable iTunes Match on the empty library. Once the scan is finished you may delete tracks from the cloud. When you are done switch back to the main iTunes library.

  • TS5376 I'm having a problem with downloading and installing the new version of itunes for windows (11.1.4)  I have done everything the troubleshooting article has said and it is still not working properly.

    'm having a problem with downloading and installing the new version of itunes for windows (11.1.4)  I have done everything the troubleshooting article has said and it is still not working properly.  I have even done a repair to see if that works and it has not.  Has anyone else found a new way to get it working?

    Try Troubleshooting issues with iTunes for Windows updates.
    tt2

  • Please is an emergenci!!! I put my iPhone 5 to charge and the cable is not working I tried in other pluggers in the house but nothing I don't know what's wrong and I don't have any more battery

    Hey I plug my iPhone 5 and the charger is not working and I'm freaking out!!! It never hasn't happened and I just have in this moment 4% I all ready tried on pther pluggers on the house and is the charges that doesn't work. What should I do?

    @whimsei,
    Hello and thank you for posting back.  What it sounds like is the cable that connects to the screen from the motherboard has either come loose or has a issue after the fall.
    To fix this it would have to be opened up and the connections checked.  If there is an issue with the cable then it would have to be replaced.  This will require either you opening up the system yourself and checking the connections and tha cable or sending it in for repair.
    Here is the link to the maintenance and service guide.  If you feel comfortable doing the work it will help you.
    HP 2000 Notebook PC Compaq Presario CQ58 Notebook PC
    Maintenance and Service Guide
    If you want to send it in for repair here is how.
    Please call our technical support at 800-474-6836. If you live outside the US/Canada Region, please click the link below to get the support number for your region.
    http://www8.hp.com/us/en/contact-hp/ww-phone-assist.html
    Please let me know how things go.
    Thank you again for posting and have a great day.
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    D5GR
    I work on behalf of HP

  • I bought an IPAD air from state and the screen is not working correctly and right now i'm in Egypt ,can i send my ipad to service in Egypt and the warranty will work in Egypt or what?

    i bought an IPAD air (32 gb wifi only) from USA just one month ago and the screen is not working correctly(picture attached) and right now i'm in Egypt ,can i send my ipad to service in Egypt and the warranty will work in Egypt or what?

    Have you tried a soft-reset to see if that fixes it ? You might be able to get warranty service in Egypt for your iPad, but the warranty includes :
    IMPORTANT RESTRICTION FOR iPHONE AND iPAD SERVICE.
    Apple may restrict warranty service for iPhone and iPad to the country where Apple or its Authorized Distributors originally sold the device.
    As it's wifi-only you should have a better chance of it being serviced under warranty, but there are no guarantees, it might depend upon the repairer.
    Egypt authorised service providers : https://locate.apple.com/eg/en/

Maybe you are looking for