Skip to content

Instantly share code, notes, and snippets.

View stickupkid's full-sized avatar

Simon Richardson stickupkid

View GitHub Profile
@stickupkid
stickupkid / gist:596639
Created September 25, 2010 09:06 — forked from claus/gist:594367
<?xml version="1.0" encoding="utf-8"?>
<!--
Show the compile date of a SWF.
See http://wahlers.com.br/claus/blog/undocumented-swf-tags-written-by-mxmlc/
-->
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
minWidth="600" minHeight="400"
/*
Implements different bin packer algorithms that use the MAXRECTS data structure.
See http://clb.demon.fi/projects/even-more-rectangle-bin-packing
Author: Jukka Jylänki
- Original
Author: Claus Wahlers
- Ported to ActionScript3
@stickupkid
stickupkid / gist:596641
Created September 25, 2010 09:07 — forked from claus/gist:523033
// Draws the first glyph of the first embedded font in a SWF
// Visualizes on and off curve points
import com.codeazur.as3swf.SWF;
import com.codeazur.as3swf.tags.TagDefineFont3;
import com.codeazur.as3swf.exporters.AS3GraphicsDataShapeExporter;
import flash.display.IGraphicsData;
import flash.display.GraphicsPath;
import flash.display.GraphicsPathCommand;
import flash.geom.Point;
@stickupkid
stickupkid / gist:596642
Created September 25, 2010 09:07 — forked from claus/gist:456130
<?xml version="1.0" encoding="utf-8"?>
<!-- Convert HTML to XML and use E4X to access DOM (AIR required) -->
<s:WindowedApplication
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="creationCompleteHandler(event)">
<fx:Script>
<![CDATA[
/**
*
*
* ScaleBitmap
*
* @author Didier Brun
* @author Jerôme Decoster
* @author Simon Richardson
* @version 1.2
*
@stickupkid
stickupkid / SignalBindingList.as
Created April 20, 2011 16:31
SignalBindingList
package org.osflash.signals
{
/**
* The SignalBindingList class represents an immutable list of SignalBinding objects.
*
* @author Joa Ebert
* @private
*/
public final class SignalBindingList
{
@stickupkid
stickupkid / describeDisplayList.as
Created May 12, 2011 10:01
Describe the DisplayList as XML
package utils
{
import flash.display.DisplayObject;
import flash.display.DisplayObjectContainer;
import flash.utils.getQualifiedClassName;
/**
*
*/
public function describeDisplayList(displayObject : DisplayObject) : XML
package
{
public class AsciiTable
{
public static const table : Vector.<String> = Vector.<String>([
'NUL',
'SOH',
'STX',
function RGBtoRGBA(r, g, b){
(g==void 0) && (typeof r == 'string') &&
(r = r.replace(/^\s*#|\s*$/g, ''),
(r.length == 3) && (r = r.replace(/(.)/g, '$1$1')),
g = parseInt(r.substr(2, 2), 16),
b = parseInt(r.substr(4, 2), 16),
r = parseInt(r.substr(0, 2), 16));
var min, a = ( 255 - (min = Math.min(r, g, b)) ) / 255;
@stickupkid
stickupkid / gist:1147326
Created August 15, 2011 18:00
Run HTML in AIR...
import flash.html.HTMLLoader;
var content : String = '<!DOCTYPE html>\
<head>\
<style>\
@-webkit-keyframes pulse {\
0% {\
background-color: red;\
opacity: 1.0;\
-webkit-transform: scale(1.0) rotate(0deg);\