Packagecom.myflashlab.air.extensions.barcode
Classpublic class Barcode
InheritanceBarcode Inheritance flash.events.EventDispatcher

Barcode Extension uses zxing library, http://code.google.com/p/zxing/wiki/LicenseQuestions on Android and native AVMetadataObjectType for the iOS side, to open your mobile camera and scan for any barcode. you could have also used camera from the air api and detect barcodes but it would had caused big performance issues on your air app.

Make sure to take care of the permissions first: https://github.com/myflashlab/barcode-ANE/#permissions



Public Properties
 PropertyDefined By
  context : ExtensionContext
[read-only]
Barcode
Public Methods
 MethodDefined By
  
Initialize the barcode scanner extension
Barcode
  
dispose():void
when you're done with this extension, call this method to free up the memory.
Barcode
  
isSupported():Boolean
This extension is supported on Android SDK 15 or higher and iOS 8.0 or higher.
Barcode
  
open($scanTypes:Array = null, $beepSound:File = null, $toVibrate:Boolean = false, $cancelBtnLabel:String = Cancel):Boolean
Use this method to run the camera and start detecting barcodes.
Barcode
  
warmup():void
Barcode
Public Constants
 ConstantDefined By
  ALL : Array
[static]
Barcode
  AZTEC : String = org.iso.Aztec
[static]
Barcode
  CODE128 : String = org.iso.Code128
[static]
Barcode
  CODE39 : String = org.iso.Code39
[static]
Barcode
  DATAMATRIX : String = org.iso.DataMatrix
[static]
Barcode
  EAN13 : String = org.gs1.EAN-13
[static]
Barcode
  EAN8 : String = org.gs1.EAN-8
[static]
Barcode
  EXTENSION_ID : String = com.myflashlab.air.extensions.barcode
[static]
Barcode
  ITF14 : String = org.gs1.ITF14
[static]
Barcode
  PDF417 : String = org.iso.PDF417
[static]
Barcode
  QR : String = org.iso.QRCode
[static]
Barcode
  UPCE : String = org.gs1.UPC-E
[static]
Barcode
  VERSION : String = 4.0.3
[static]
Barcode
Property Detail
contextproperty
context:ExtensionContext  [read-only]


Implementation
    public function get context():ExtensionContext
Constructor Detail
Barcode()Constructor
public function Barcode()

Initialize the barcode scanner extension

Method Detail
dispose()method
public function dispose():void

when you're done with this extension, call this method to free up the memory. If you call this method, you will have to reinitialize the extension to be able to work with it.

isSupported()method 
public function isSupported():Boolean

This extension is supported on Android SDK 15 or higher and iOS 8.0 or higher.

Returns
Boolean — Boolean
open()method 
public function open($scanTypes:Array = null, $beepSound:File = null, $toVibrate:Boolean = false, $cancelBtnLabel:String = Cancel):Boolean

Use this method to run the camera and start detecting barcodes.

Parameters

$scanTypes:Array (default = null) — set to null to read all barcodes supported with this ANE. but it will improve performance if you set only those which you require in your app only.
 
$beepSound:File (default = null) — set to null if you don't want any beep sound to be played when the barcode is read.
 
$toVibrate:Boolean (default = false) — set to true if you wish the device to vibrate a little when a barcode is detected.
 
$cancelBtnLabel:String (default = Cancel) — There's no back button on iOS, so you can set the label of the cancel button on iOS side with this parameter. this button won't be shown on Android at all.

Returns
Boolean — returns true if the operation is succefull.
warmup()method 
public function warmup():void

Constant Detail
ALLConstant
public static const ALL:Array

AZTECConstant 
public static const AZTEC:String = org.iso.Aztec

CODE128Constant 
public static const CODE128:String = org.iso.Code128

CODE39Constant 
public static const CODE39:String = org.iso.Code39

DATAMATRIXConstant 
public static const DATAMATRIX:String = org.iso.DataMatrix

EAN13Constant 
public static const EAN13:String = org.gs1.EAN-13

EAN8Constant 
public static const EAN8:String = org.gs1.EAN-8

EXTENSION_IDConstant 
public static const EXTENSION_ID:String = com.myflashlab.air.extensions.barcode

ITF14Constant 
public static const ITF14:String = org.gs1.ITF14

PDF417Constant 
public static const PDF417:String = org.iso.PDF417

QRConstant 
public static const QR:String = org.iso.QRCode

UPCEConstant 
public static const UPCE:String = org.gs1.UPC-E

VERSIONConstant 
public static const VERSION:String = 4.0.3