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
| //put this class in src/main/as3 | |
| package | |
| { | |
| import flash.display.Sprite; | |
| import org.robotlegs.v2.core.impl.Context; | |
| import org.swiftsuspenders.ReflectorBase; | |
| [SWF(width="1024",height="768")] | |
| public class MyProject extends Sprite | |
| { |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <scheme name="BlueForestDev" version="1" parent_scheme="Default"> | |
| <option name="LINE_SPACING" value="1.1" /> | |
| <option name="EDITOR_FONT_SIZE" value="12" /> | |
| <option name="EDITOR_FONT_NAME" value="Menlo" /> | |
| <colors> | |
| <option name="ADDED_LINES_COLOR" value="8080" /> | |
| <option name="ANNOTATIONS_COLOR" value="8080ff" /> | |
| <option name="ANNOTATIONS_MERGED_COLOR" value="80ff80" /> | |
| <option name="CARET_COLOR" value="ffffff" /> |
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
| // ActAsDog.as | |
| public function bark(): void | |
| { | |
| trace("bark"); | |
| } | |
| // ActAsCat.as | |
| public function meow(): void |
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
| haxelib install nodejs 0.6 |
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
| static inline function array_delete_if<T>( array: Array<T>, processor: T -> Bool ):Array<T> | |
| { | |
| for ( item in array ) | |
| if ( processor(item) ) | |
| array.remove( item ); | |
| return array; | |
| } |
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
| var x; // type of x is Unknown | |
| x = "I'm a String"; // type of x is set to String | |
| x = 1; // this will cause a compiler error as Int cannot be assigned to String |
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
| var x: String; // type is now set to String | |
| x = "I'm a String"; // this will work | |
| x = 1; // this will cause an error |
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
| function inferred(x) { | |
| return x; | |
| } | |
| inferred("abc"); // will take the string and return it | |
| inferred(1); // will throw a compiler error because x is typed to String now |
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
| function square( x: Float ) { | |
| return x * x; | |
| } |
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
| var square = function(x: Float) { | |
| return x * x; | |
| } | |
| type(square); // type of square is Float -> Float |