Skip to content

Instantly share code, notes, and snippets.

makc

Block or report user

Report or block makc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@makc
makc / InstanceMetadataEditor.as
Created Sep 5, 2013
Instance metadata editor
View InstanceMetadataEditor.as
package {
import com.bit101.components.PushButton;
import com.bit101.components.TextArea;
import com.codeazur.as3swf.SWF;
import com.codeazur.as3swf.tags.*;//TagPlaceObject;
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.display.Loader;
import flash.display.Sprite;
import flash.events.Event;
@makc
makc / gist:4055965
Created Nov 11, 2012
Integral image
View gist:4055965
var w:int = bitmapData.width, w1:int = w + 1, w2:int = w + 2, h:int = bitmapData.height, h1:int = h + 1, length:int = w1 * h1;
var integralImage:Vector.<int> = new Vector.<int> (length, true);
var vec:Vector.<uint> = bitmapData.getVector (bitmapData.rect);
var i/*nput*/:int = 0, o/*utput*/:int = w2, s:int;
for (var y:int = 0; y < h; y++, o++) {
s = 0;
for (var x:int = 0; x < w; x++, o++, i++) {
@makc
makc / Pool.as
Created Jun 27, 2012
General purpose instance pool class (feel free to improve :)
View Pool.as
package com.realaxy.operators{
import flash.utils.Dictionary;
internal class Pool {
private var instances : Dictionary =new Dictionary() ;
private var instanceCounts : Dictionary =new Dictionary() ;
public function getInstance ( type : Class ) : * {
var cache : Vector.<*>;
if ( instanceCounts[type] ) {
You can’t perform that action at this time.