Packageardisia.components.barCode
Classpublic class BarCode
InheritanceBarCode Inheritance spark.components.Group

Generates and displays several different types of 1-D barcodes.

Generally, this component does not validate the encoded data. It is up to the developer to ensure data is of the correct format before feeding it to this class for encoding. This component does not manage quiet zones. See the specification files for some notes on required quiet zone widths.

Explicit dimensions will work, but it is recommended to use measured dimensions because in that case encoded data will be displayed using whole pixels. Explicit dimensions may use partial pixels and therefore be harder for barcode readers to decode. To control the relative size of measured bar codes, use the "resolution" property.

For the 1-D barcodes (with measured dimensions), the line width is determined directly by the "resolution" property which in turn determines the measured width.

In summary, explicit dimensions are allowed, but this may cause partial pixels to be drawn and therefore be harder for a barcode reader to read. Use measured dimensions and control the relative size via the "resolution" property.

View the technical documentation on the Ardisia Labs website for more information.

Default MXML PropertymxmlContent



Public Properties
 PropertyDefined By
  barColor : Number
The color of the bar code rectangles/lines.
BarCode
  resolution : int
Resolution to draw data in the bar code.
BarCode
  type : String
Set the type of barcode to generate.
BarCode
  value : String
The value to encode.
BarCode
Protected Methods
 MethodDefined By
  
Creates the encoded string or image.
BarCode
Property Detail
barColorproperty
barColor:Number

The color of the bar code rectangles/lines.

The default value is 0x000000.


Implementation
    public function get barColor():Number
    public function set barColor(value:Number):void
resolutionproperty 
resolution:int

Resolution to draw data in the bar code.

Sets the thickness of each vertical line drawn on screen.

Adjust to make the bar code wider and/or smaller. Minimum of 1.

The default value is 2.


Implementation
    public function get resolution():int
    public function set resolution(value:int):void
typeproperty 
type:String

Set the type of barcode to generate.

The default value is "codabar".

This property can be used as the source for data binding.


Implementation
    public function get type():String
    public function set type(value:String):void
valueproperty 
value:String

The value to encode. Not validated for a particular bar code type.

The default value is undefined.

This property can be used as the source for data binding.


Implementation
    public function get value():String
    public function set value(value:String):void
Method Detail
generateEncoding()method
protected function generateEncoding():void

Creates the encoded string or image.