Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9187921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:53:28+00:00 2026-06-17T19:53:28+00:00

I like so many others is trying to implement a barcode scanner for my

  • 0

I like so many others is trying to implement a barcode scanner for my Flex Mobile app using the zxing actionscript library. My issue is that I’m having a heck of a time just getting the camera to display properly on the actual device. Running the app on the desktop with a webcam shows the video feed just fine. Below is what i get on my Galaxy Nexus and similar on the Nexus 7.

on the galaxy nexus

I’ve been primarily working off of this example but have taken suggestions from other sites as well:
http://www.remotesynthesis.com/post.cfm/adding-a-qr-code-reader-in-flex-on-android

Everything produces the same wacky feed to the Video Object. Anybody know what I could do to correct this?

Here’s my code in its current form which is just trying to get a clear picture at this point (no barcode junk yet):

scanner2.mxml

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:bs="com.expologic.barcodescanner"
    title="Scanner" creationComplete="init(event)">
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>

<fx:Script>
    <![CDATA[
        import mx.core.UIComponent;

        import com.expologic.barcodescanner.BarcodeScanner;

        private var bs:BarcodeScanner;

        private function init(e:Event):void {

            bs = new BarcodeScanner();
            bs.horizontalCenter = 0;
            bs.verticalCenter = 0;
            bs.height = 480;
            bs.width = 640;

            addElement(bs);

            //To add a target to the center of the screen
            var uic:UIComponent = new UIComponent();
            this.addElement(uic);

            uic.width = uic.height = 275;
            uic.graphics.lineStyle(3,0xFF0000);
            uic.graphics.drawRect(0,0,275,275);

            uic.horizontalCenter = uic.verticalCenter = 0;

        }


    ]]>
</fx:Script>



</s:View>

BarcodeScanner.as

package com.expologic.barcodescanner
    {

        import flash.events.Event;
        import flash.media.Camera;
        import flash.media.Video;

        import spark.core.SpriteVisualElement;

        public class BarcodeScanner extends SpriteVisualElement
        {

            private var _video:Video;

            public function BarcodeScanner()
            {

                this.height = 480;
                this.width = 640;

                addEventListener(Event.ADDED_TO_STAGE, _addToStage);

            }

            private function _addToStage(e:Event):void {
                _setupCamera();
            }


            private function _setupCamera():void
            {

                if(!_video)
                {
                    _video = new Video(640, 480);
                    addChild(_video);
                }

                if(Camera.isSupported)
                {
                    var cam:Camera = Camera.getCamera();
                    cam.setQuality(0, 100);
                    cam.setMode(640, 480, 30, false);

                    _video.attachCamera(cam);
                }
            }

        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:53:29+00:00Added an answer on June 17, 2026 at 7:53 pm

    Try to set <renderMode>direct</renderMode> in your app.xml, that solved the problem for me and I’m also using the Galaxy Nexus.
    Regards
    Joko

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Like many others, I am trying to draw 3D objects (using GLSurfaceView) on camera
I am creating dynamic TextFields in actionscript 3.0. Like many others, my text disappears
Trying to bend by head around Javascript's take on OO...and, like many others, running
Like many others Knockout developers before me, I encountered a slow running script warning
I, like many others, love Eclipse as my ide of choice, and because of
This sounds like a problem many others have posted about, but there's a nuance
I'm trying to understand how to best implement a polymorphic one-to-many in hibernate. Eg:
I'm trying to implement a simple Inbox system for users of my app so
I 'm trying to implement user authentication and authorization using roles table, user table
I am trying to implement what I thought was a simple scenario using an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.