QR Zbar is a native extension that allows an application to read QR and bar codes on Android and iOS. Before start scanning the extension can be configured and tweaked, so it’s possible to specify the size and colors of the target area for bar code scanning, for instance.
After the extension is ready, the developer can programmatically launch the scanning UI, which can remain active until the user stops using it or it can auto-close after the scan process. When the target is successfully scanned, an event is fired containing the read data.
Sample
var s:Scanner = new Scanner(); s.resetConfig(); // Only QR Code By default s.addEventListener(ScannerEvent.SCAN,onScan); // Multiple scans, until user presses back button to come back to the app. s.startPreview("rear"); s.attachScannerToPreview(); private function onScan(event:ScannerEvent):void { trace("Scan Event " + event.data); s.stopPreview(); }
RT @as3gamegears: New: QR Zbar (native extension to read QR and bar codes on Android and iOS) http://t.co/mLZjNpsJaR #as3 #flash #gamedev
how would I set this to scan only QR Codes? I feel like I should just use
scanner.setConfig(Symbology.QRCODE,Config.ENABLE,1);
but this doesn’t seem to be working
I would do what you described. It’s strange it doesn’t work. Try disabling the other symbols, maybe it will do the trick.
If that doesn’t work either, ping the ANE author @saumitrabhave and ask for help.
got error using this, could You help me fixing this
[Fault] exception, information=Error: Extension not supported
Fault, Scanner() at Scanner.as:45
You should check that error with @saumitrabhave, the author of the ANE. Maybe your didn’t provide the right permissions to the ANE, so it can’t use the camera; or your simulator does not provide a virtual camera.
Hi Fernando, Thanks very much for sharing the ANE. I have moved the repository to github at https://github.com/saumitrabhave/qr-zbar-ane can you please update the post accordingly.
developers can post issues there and I will be happy to fix them.
Hi! You are welcome! It’s great to know you have moved to Github. I already updated all the links. Thanks for letting me know about the change.
@as3gamegears I have Improved all the APIs for more flexibility in customizing the UI. This sample may now be obsolete and may not work.