This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isCreditCard(CC) { | |
if (CC.length > 19) | |
return (false); | |
var sum = 0; var mul = 1; var l = CC.length; var digit; var tproduct; | |
for (var i = 0; i < l; i++) { | |
digit = CC.substring(l - i - 1, l - i); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this: | |
context.clearRect(0, 0, width, height); | |
// or: | |
canvas.width = canvas.width; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static function copy(d:DisplayObject, w:Number, h:Number, smoothing : Boolean = true): Bitmap | |
{ | |
var data:BitmapData = new BitmapData(w, h, true, 0xffffff); | |
var bmp:Bitmap = new Bitmap(data); | |
bmp.smoothing = smoothing; | |
bmp.bitmapData.draw(d); | |
return bmp; | |
} |
NewerOlder