BarCode 39 is a bar codes generator Flash component, wich can be printed/scanned on sheet labels or custom packaging.
BarCode 39 (sometimes called "code 39") is a widely used barcode standard that includes capital letters, numbers, and several symbols. This is not the barcode for UPC's (universal price codes) found on products at the store. However, most kinds of barcode scanners will recognize 3 of 9 just fine.
It only encodes code 39 type barCodes, but it can be extended to include all the ASCII characters. This component is good, because you don't have to embed large BarCode fonts!
Start creating barcodes out of a string (if the string contains a
character which cannot be encoded, it will skip that character). And best of all, it's FREE!
Credits:
Librarian - AS 2.0 / Flash Player 7 and above adjustments;
Chad Adams - Original BarCode39 Class for Flash Player 6 / AS 1.0;
Librarian recommends:
2 comments
Add comment
naglma
It is proper to add this line of code after the barcode has been generated:
this.bars_mc.bar_mc.removeMovieClip();
It will remove the source line.
The position of the code line is described below.
var draw_array = bars_str.split("");
for(var i = 0;i < draw_array.length; i++){
barDepth++;
var drawBar = int(draw_array[i]);
if (drawBar){
the_mc = this.bars_mc.bar_mc.duplicateMovieClip("bar"+barDepth+"_mc", barDepth);
the_mc._x = barDepth;
}
}
this.bars_mc.bar_mc.removeMovieClip();
It is also proper to add the delimiter to the code inside of the class so you don't need to add it outside of the class.:
var my_str = "*"+this.the_str+"*";
Bare bones, out of the box, you would enter the code *WIKIPEDIA* like the wiki page for code 39 and you will see that this generator produces 1 extra line out in front of the code. As described above, it is the un-removed movie clip that is used as a copy source for the lines in the barcode.
#  /  PM  /  posted on Jul 30, 2010
latashag
new to actionscript 1. this doesnt seem to work in AS3. do you have one for as3 or have a way to make it work in as3 2. how could i save the code that is generated
#  /  PM  /  posted on Dec 05, 2010