This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a class that expects a MyData | |
public class SomeObject | |
{ | |
[Inject] | |
public var data:MyData; | |
} | |
// configure a signal to trigger a command that contains a reference to that class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// due to Neko's 31 bit integers and other nonsense, when you set a bitmap data's alpha value | |
// through Neko and then read it back out, the number ranges from -127 to 127 rather than from | |
// 0 to 255. Bongo madness. To unbongo, convert as follows: | |
var bitmapData = new BitmapData(1, 1, true, {rgb:0, a:0}); | |
for (i in 0...256) | |
{ | |
bitmapData.setPixel32(0, 0, {rgb:0xFFFFFF, a:i}); | |
var alpha = bitmapData.getPixel32(0, 0).a; | |
var converted = alpha < 0 ? 255 + alpha : alpha; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cdf: cd to the front finder's location | |
cdf () | |
{ | |
currFolderPath=$( /usr/bin/osascript <<" EOT" | |
tell application "Finder" | |
try | |
set currFolder to (folder of the front window as alias) | |
on error | |
set currFolder to (path to desktop folder as alias) | |
end try |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum MyEnum | |
{ | |
first; | |
second; | |
third(param:MyParam); | |
} | |
class MyClass | |
{ | |
private var _state:MyEnum; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Sprite; | |
import flash.utils.describeType; | |
[SWF(backgroundColor="#FFFFFF", frameRate="60", width="800", height="600")] | |
final public class Test extends Sprite | |
{ | |
public function TestRunner() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package | |
{ | |
import flash.display.Sprite; | |
[SWF(backgroundColor="#FFFFFF", frameRate="60", width="800", height="600")] | |
final public class Test extends Sprite | |
{ | |
public function Test() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A ProcessStack is a utility that will wait run each process in order as added, | |
* running the subsequent process when it has completed | |
*/ | |
public class InitProcess extends ProcessStack | |
{ | |
public function InitProcess() | |
{ | |
add(InitModelProcess); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. github.com/robotlegs/robotlegs-framework/blob/master/src/org/robotlegs/base/CommandMap.as: | |
// only one mapping possible | |
mapValues(); | |
command = createCommand(mapping); | |
unmapValues(); | |
command.execute(); | |
2. github.com/joelhooks/signals-extensions-CommandSignal/blob/master/src/org/robotlegs/base/SignalCommandMap.as: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a difference is not a difference unless it *makes* a difference | |
public function add(item:*):Boolean | |
{ | |
if (contains(item)) | |
return false; | |
push(item); | |
return true; | |
} |