As of late 2021, we are in the process of updating Stencylpedia and fixing up outdated & broken content. Thanks for your patience!
Contents
- Introduction
- Differences
- Further Reading
Introduction
With our move towards a unified, cross-platform enginem we've adopted Haxe, a language that's remarkably similar to ActionScript 3, but at the same time, has enough small differences to force all existing code to be ported. This guide is a light introduction to Haxe for AS3 developers.
Differences
Areas where the basic syntax and structures are different include...
- Basic Types are slightly different and all capitalized.
- Package Declarations are done Java-style.
-
Class Definitions don't include public. Constructors are defined using new rather than
- For Loops have a more concise syntax.
- Casting has a different syntax.
- Checking for "null" has to be done explicitly.
- No Dictionaries, but Haxe has strongly-typed Maps.
- Function pointers have to be typed explicitly.
- Getter/Setter syntax is different.
- All package must be in lower-case, but all class names must start with upper case.
- You can't import classes using wildcards.
Further Reading
Disclaimer: Use comments to provide feedback and point out issues with the article (typo, wrong info, etc.). If you're seeking help for your game,
please ask a question on the forums. Thanks!
6 Comments
CmdrWhitey13
Under Introduction-> Typo
Introduction
"With our move towards a unified, cross-platform enginem"
should be engine and not enginem.
0
Under Introduction-> Typo
Introduction
"With our move towards a unified, cross-platform enginem"
should be engine and not enginem.
0