Skip to content

Instantly share code, notes, and snippets.

View pixels4nickels's full-sized avatar

Ken Rogers pixels4nickels

  • Oakland, California
View GitHub Profile
@pixels4nickels
pixels4nickels / app.html
Last active June 21, 2016 02:11 — forked from Vheissu/app.html
Dynamic html template insertion with manual model binding
<template>
<require from='./my-element.html'></require>
</template>
@pixels4nickels
pixels4nickels / AnimatedH2DSprite.hx
Created May 6, 2013 05:51
AnimatedSprite for h2d library. AnimatedH2DSprite.hx subclasses h2d.Sprite.hx instead of flash.display.Sprite. Spritesheet.hx was updated because h3d/h2d libraries use Haxe 3. Hash references were replaced with Map.
import h2d.Scene;
import h2d.Sprite;
import h2d.Bitmap;
import h2d.Tile;
import com.eclecticdesignstudio.spritesheet.data.BehaviorData;
import com.eclecticdesignstudio.spritesheet.Spritesheet;
import flash.display.BitmapData;
@pixels4nickels
pixels4nickels / Game.as
Last active December 10, 2015 11:49
Kata bowling excercise. create a bowling game using 1 game class with 2 methods: roll(pins:int) and score():int . call score() after all rolls are completed.
package {
import flash.utils.Dictionary;
import spark.components.TextArea;
public class Game {
private const TOTAL_LABEL:String = "Total: ";
private const GUTTER_LABEL:String = "Gutter!";
private const OPEN_FRAME:String = "You got ";
private const FRAME_LABEL:String = "Frame: ";
@pixels4nickels
pixels4nickels / Main.nmml
Created November 18, 2012 17:53
nmml for createjs haxelib
<?xml version="1.0" encoding="utf-8"?>
<project>
<meta title="Prototype" package="com.p4n.prototype" version="1.0.0" company="fubard" />
<app main="Main" file="Main" path="bin" />
<window width="800" height="600" unless="mobile" />
<window fps="30" />
<source path="src" />
<haxelib name="createJS" />
<template path="assets/template" rename="../bin"/>
<assets path="assets/js" rename="js"/>
@pixels4nickels
pixels4nickels / ImageButton.as
Created January 17, 2012 07:27 — forked from thanksmister/ImageButton.as
Flex Spark Image Button component with rounded corners. Wraps the Image control and takes same source for image. .
/**
* @authors Michael Ritchie, Ken Rogers
* @twitter @thanksmister, @pixels4nickels
* @version Dec 9, 2011
* */
package
{
import flash.events.Event;
import mx.events.FlexEvent;