This file contains 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
/* Save this file with a jsx extension and place in your | |
Illustrator/Presets/en_US/Scripts folder. You can then | |
access it from the File > Scripts menu */ | |
var decimalPlaces = 3; | |
function calculateArea (obj) { | |
if (obj.typename == "PathItem") { | |
return obj.area; // could be negative | |
} else if (obj.typename == "CompoundPathItem") { |
This file contains 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
import flash.display.Sprite; | |
import flash.Lib; | |
class Test { | |
static function linear(t:Float) : Float return t; | |
static function quad(t:Float) : Float return t * t; | |
static function cubic(t:Float) : Float return t * t * t; | |
static function quart(t:Float) : Float return t * t * t * t; | |
static function quint(t:Float) : Float return t * t * t * t * t; | |
static function poly(t:Float, p:Float=2.0) : Float return Math.pow(t, p); |
This file contains 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
var bd = Assets.getBitmapData("img/sumachan.png"); | |
var temp:BitmapData = new BitmapData(300, 300, true, 0); | |
temp.copyPixels(bd, new Rectangle(0, 0, 300, 300), new Point(0, 0)); | |
var data:Data = Tools.build32ARGB(temp.width, temp.height, Bytes.ofData(temp.getPixels(temp.rect))); | |
var bo:BytesOutput = new BytesOutput(); | |
var writer:Writer = new Writer(bo); | |
writer.write(data); | |
var byteArray:ByteArray = bo.getBytes().getData(); |