Read QR Code With QRCodeReader Open-Source AS3 Library - Ntt.cc

Read QR Code With QRCodeReader Open-Source AS3 Library

Barcode-icon QR(Quick Response) is a matrix code created by Japanese corporation Denso-Wave in 1994. QR code can store addresses and URLs be appeared in magazines, on signs, business cards and other that users might need information. Users with a camera phone equipped with the reader application can recognize QR code from image, and decode it to string quickly. For people who want to use QR Codes within the Flash environment, QRCodeReader should be a good solution, it is essentially an open source library in ActionScript 3 that recognizes and decodes any QR Code from any image source. with this library, you can easily integrate your own QR reader into your AS3 mobile application.

Source Code


Access QRCodeReader Repository to get full source code.

Main Classes


This library is made from 2 main Classes:

  1. GetQRimage Class recognizes QR Code from image.
  2. QRdecode Class decodes QR Code to string.

Usage


GetQRImage:

// set DisplayObject contains a QR Code
getQRimage = new GetQRimage(imageSrc); // imageSrc:DisplayObject(Sprite, Video, …)
// run onQrImageReadComplete when the QR Code is found
getQRimage.addEventListener(QRreaderEvent.QR_IMAGE_READ_COMPLETE, onQrImageReadComplete);
// begin recognition. you may run this every frame when the image source is viewed by a webcam.
getQRimage.process();

// invoked when QR Code is found
function onQrImageReadComplete(e:QRreaderEvent):void{
// e.data is a 2D bit array of QR Code
}

The bit array of QR Code obtained by GetQRimage can be decode by QRdecode Class.

QRdecode:

// set 2D bit array of QR Code
qrDecode.setQR(e.data); // e:QRreaderEvent
// run onQrDecodeComplete when decoding is complete
qrDecode.addEventListener(QRdecoderEvent.QR_DECODE_COMPLETE, onQrDecodeComplete);
// begin decoding
qrDecode.startDecode();

// invoked when decoding is complete
function onQrDecodeComplete(e: QRdecoderEvent):void{
// e.data is the string decoded from QR Code
}

You also can get a full sample source code from here and more details from here. Please notice, for running the sample code, you need to connect a webcam to your computer.

Read QR Code With QRCodeReader Open-Source AS3 Library

In additional


Author Kenichi UENO is a Japanese, QR Codes are common in Japan, where they are currently the most popular type of two dimensional codes. Moreover, most current Japanese mobile phones can read this code with their camera.

Google’s mobile Android operating system supports the use of QR codes by natively, and Nokia’s Symbian operating system is also provided with a barcode scanner, which is able to read QR Codes. You also can create a mobile code with a few simple clicks from nokie mobile codes.

In fact, not only in the mobile environment, it is interesting too that provide a box on your webpage where the user can hold their qr code up to their webcam and be able to see their qr code on the computer screen, and take a picture of their code and retrieve their text kind like what is happening in this link. :)

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • Reddit
  • Technorati
  • StumbleUpon
  • Twitter
RSS Enjoy this Post? Subscribe to Ntt.cc

RSS Feed   RSS Feed     Email Feed  Email Feed Follow us Follow us
You can leave a response, or trackback from your own site.

8 Responses to “Read QR Code With QRCodeReader Open-Source AS3 Library”

  1. Good post, Here is a post I developed as part of a series titled The Internet of Things. It is surprising that QR codes have taken this long to reach America and be adopted by the advertising crowd. Apparently, they don’t know a good thing when they see it. Thanks for the AS3 development insight, I will pass on the link.

  2. lokker says:

    mm…useful for me , thanks

  3. Maciej says:

    Hello,
    is there a way to use that library in Flex 4?
    I’m new to Flex and I have no idea if this is going to work there…

  4. Richard says:

    hello,

    I am currently working on software for student attendance. I use the flex / flash and php to create the software but I faced a problem barcode scanner (Motorola-type barcode scanner Symbol LS2208 Laser Barcode Scanner – USB), can not connect to the application to call the data from the database when students scan the barcode printed on their student card.

    Can you help me to make the script so that it can run on flex / flash and php. it makes me crazy for a week to seek a way out …. please help me

    thanks,

    ps : i use flex 4 / flash cs 5

  5. Chad says:

    Hello,
    I”m using Flash Professional CS5.5

    I”ve been able to get this to work as far as the video showing up on screen and I’ve been putting different QR codes in front of the camera however it doesn’t do anything.

    I’m publishing it out to iPad, however I haven’t been able to get this to work on my computer or iPad.

    I can see the video and the markers to put the QR image in front of, but it just isn’t doing the reading.
    Any input would be greatly appreciated.

  6. Erwinus says:

    Sorry to say but demo does not do anything, does not read any qr-code.
    Waste of time.

Leave a Reply