Skip to content

Instantly share code, notes, and snippets.

View trxcllnt's full-sized avatar

Paul Taylor trxcllnt

  • NVIDIA, Inc
  • Portland, OR
  • 19:43 (UTC -07:00)
  • X @inlineptx
View GitHub Profile
package
{
import embeds.*;
import flash.display.*;
import org.swiftsuspenders.*;
import org.tinytlf.*;
import org.tinytlf.html.*;
import org.tinytlf.util.TagSoup;
@trxcllnt
trxcllnt / CSS.as
Created August 21, 2011 22:22
A small CSS parser in AS3. Part of tinytlf 2.0.
package org.tinytlf.html
{
import flash.utils.getTimer;
import org.tinytlf.*;
public class CSS extends Styleable
{
[Embed(source = "default.css", mimeType = "application/octet-stream")]
private const defaultCSS:Class;
@trxcllnt
trxcllnt / WhateverService.as
Created July 26, 2011 20:13
Asynchronous service example with signals as promises enabling functional and fluent API interaction.
package
{
public class MyService
{
[Inject]
public var session:ISession;
private var startedSignal:ISignal;
public function startMyService():ISignal
{
@trxcllnt
trxcllnt / Main.as
Created May 24, 2011 05:55
Functional and modular text layout algorithm shell.
package
{
import flash.display.*;
import flash.text.engine.*;
import org.tinytlf.layout.*;
import org.tinytlf.layout.properties.LayoutProperties;
import org.tinytlf.util.fte.ContentElementUtil;
[SWF(width="500", height="300")]
package org.robotlegs.variance
{
public interface IPackageFilters
{
/**
* Registers a package name to check against in <code>applyFilters()</code>.
*
* @see IPackageFilters#applyFilters
*/
function registerPackageFilter(packageFilter:String):void;
package org.puremvc.as3.multicore.utilities.lazy.interfaces
{
import flash.events.IEventDispatcher;
public interface IFacadeAdapter
{
function getFQCN(clazz:Class):QName;
function startup(eventBus:IEventDispatcher, startupCommandClass:Class = null, autoMediateCommandClass:Class = null):void;
}
}
package {
import flash.errors.IllegalOperationError;
import flash.utils.Dictionary;
import flash.utils.Proxy;
import flash.utils.flash_proxy;
use namespace flash_proxy;
public dynamic class ImmutableProxy extends Proxy {
private const propertyMap:Dictionary = new Dictionary();
@trxcllnt
trxcllnt / reflect.as
Created February 9, 2011 00:55
caches the results from Flash's describeType() call
package org.tinytlf.utils
{
import flash.utils.*;
public function reflect(type:Object, refreshCache:Boolean = false):XML
{
const typeCache:Dictionary = ReflectionCache.cache;
if(!(type is Class))
{
/**
* The MIT License
*
* Copyright (c) 2009 @author jessefreeman
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
var css:String =
"global{
fontName: Calibri;
fontSize: 26;
}
#font1{
color: #00FF00;
}
#font1 #special1{
fontWeight: bold;