Skip to content

Instantly share code, notes, and snippets.

View joshtynjala's full-sized avatar

Josh Tynjala joshtynjala

View GitHub Profile
@joshtynjala
joshtynjala / ImageSkinExample.as
Created January 20, 2016 21:40
An example of skinning a button's states in Feathers 3.0
var skin:ImageSkin = new ImageSkin(upTexture);
skin.setTextureForState(ButtonState.DOWN, downTexture);
skin.setTextureForState(ButtonState.DISABLED, disabledTexture);
skin.scale9Grid = new Rectangle(2, 2, 1, 4);
button.defaultSkin = skin;
@joshtynjala
joshtynjala / CreateJS_RunningGrant.as
Last active March 4, 2016 01:28
ActionScript transpiled by FlexJS 0.5 RC1 using CreateJS library
package
{
import createjs.Bitmap;
import createjs.LoadQueue;
import createjs.Shape;
import createjs.Sprite;
import createjs.SpriteSheet;
import createjs.Stage;
import createjs.Ticker;
import createjs.TickerEvent;
@joshtynjala
joshtynjala / Sandbox.as
Created July 28, 2015 20:23
Root class for Feathers CreateJS experimental demo at http://joshblog.net/projects/feathers-createjs/demo/
package
{
import createjs.Event;
import createjs.Rectangle;
import createjs.Stage;
import createjs.Ticker;
import createjs.Touch;
import feathers.controls.ButtonState;
import feathers.controls.ScrollPolicy;
@joshtynjala
joshtynjala / Binding.mxml
Created March 26, 2015 21:27
Feathers MXML binding
<?xml version="1.0" encoding="utf-8"?>
<f:LayoutGroup xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:f="library://ns.feathersui.com/mxml">
<f:layout>
<f:HorizontalLayout gap="10" horizontalAlign="center" verticalAlign="middle"/>
</f:layout>
<f:Slider id="slider1" minimum="0" maximum="1" value="0"/>
<f:Slider id="slider2" minimum="0" maximum="1" value="{slider1.value}"/>
</f:LayoutGroup>
@joshtynjala
joshtynjala / HelloWorld.mxml
Last active June 13, 2017 17:11
Feathers HelloWorld example ported to MXML
<?xml version="1.0" encoding="utf-8"?>
<f:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:f="library://ns.feathersui.com/mxml"
theme="feathers.themes.MetalWorksMobileTheme">
<f:layout>
<f:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
</f:layout>
<f:Button id="button" label="Click Me"
@joshtynjala
joshtynjala / HyperlinkTextFieldTextRenderer.as
Last active July 20, 2017 15:09
Feathers TextFieldTextRenderer with Hyperlinks
package feathersx.controls.text
{
import feathers.controls.text.TextFieldTextRenderer;
import flash.geom.Point;
import flash.net.URLRequest;
import flash.net.navigateToURL;
import starling.events.Touch;
import starling.events.TouchEvent;
@joshtynjala
joshtynjala / CustomLayoutGroupItemRenderer.as
Last active December 28, 2015 08:59
Feathers: This subclass of LayoutGroupItemRenderer demonstrates how to create a simple custom item renderer.
package
{
import feathers.controls.Label;
import feathers.controls.renderers.LayoutGroupListItemRenderer;
import feathers.layout.AnchorLayout;
import feathers.layout.AnchorLayoutData;
public class CustomLayoutGroupItemRenderer extends LayoutGroupListItemRenderer
{
public function CustomLayoutGroupItemRenderer()
@joshtynjala
joshtynjala / GTween.as
Created July 8, 2013 16:49
GTween for Starling
/*
Copyright (c) 2012 Josh Tynjala
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 furnished to do so, subject to the following
@joshtynjala
joshtynjala / MyFirstTypeScript.ts
Created April 26, 2013 01:25
My First TypeScript
/// <reference path="libs/easeljs/easeljs.d.ts" />
/// <reference path="libs/underscore/underscore.d.ts" />
class Main extends createjs.Stage
{
constructor(canvas: HTMLCanvasElement)
{
super(canvas);
_.bindAll(this);
@joshtynjala
joshtynjala / ShareRobotlegsCommands.as
Last active October 12, 2015 06:18
Share Robotlegs Commands between Flex and Feathers. You can use the regular Robotlegs Command class instead of the StarlingCommand class with a Starling context as long as you map a couple of things in your injector.
this.injector.mapSingletonOf(IMediatorMap, MediatorMap);
this.injector.mapSingletonOf(flash.display.DisplayObjectContainer, flash.display.Sprite);