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:
- GetQRimage Class recognizes QR Code from image.
- 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.
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.

May 1st, 2010
Ntt.cc
Posted in
Tags: 
RSS Feed
Email Feed
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.
mm…useful for me , thanks
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…
[...] 2010/09/29 by knopsod Leave a Comment http://ntt.cc/2010/05/01/read-qr-code-with-qrcodereader-open-source-as3-library.html [...]
[...] http://ntt.cc/2010/05/01/read-qr-code-with-qrcodereader-open-source-as3-library.html [...]
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
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.
Sorry to say but demo does not do anything, does not read any qr-code.
Waste of time.