File tree Expand file tree Collapse file tree 3 files changed +37
-0
lines changed
Expand file tree Collapse file tree 3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 77 - [ Type conversion] ( ./as3/type-conversion.md )
88 - [ Type matching] ( ./as3/type-matching.md )
99 - [ Classes] ( ./as3/classes.md )
10+ - [ Enums] ( ./as3/enums.md )
11+ - [ Interfaces] ( ./as3/interfaces.md )
1012 - [ Namespaces] ( ./as3/namespaces.md )
1113 - [ Events] ( ./as3/events.md )
1214 - [ Environment variables] ( ./as3/environment.md )
Original file line number Diff line number Diff line change 1+ # Enums
2+
3+ Enums are special classes consisting of zero or more variants. Use the ` enum ` definition to define enums.
4+
5+ ```
6+ enum Variant {
7+ const VARIANT_ONE;
8+ const VARIANT_TWO = "variantTwo";
9+ const VARIANT_THREE = [2, "variantThree"];
10+ }
11+ ```
12+
13+ ## Type inference
14+
15+ ```
16+ var v : Variant = "variantOne";
17+ ```
Original file line number Diff line number Diff line change 1+ # Interfaces
2+
3+ Interfaces are non opaque types that may be implemented by classes through the ` implements ` clause.
4+
5+ ```
6+ interface I {
7+ //
8+ public function m() : void;
9+
10+ //
11+ public function get x() : Number;
12+ public function set x(value);
13+ }
14+
15+ interface Ia extends I {}
16+ ```
17+
18+ All interface methods must omit the body.
You can’t perform that action at this time.
0 commit comments