More on
this in the next chapter, which discusses the use of haXe with the library SWFMill.
Flash to haXe
ActionScript 2 is the Adobe (former Macromedia) syntax used to program Flash Movies from version
6 to 8, using the Flash IDE environment or MTASC by Nicolas Cannasse, the same author of haXe. The
Flex 2 environment (the open source SDK or the commercial Flex Builder) makes use of ActionScript 3 to
target Flash movies of version 9. haXe allows use of the same language to target any Flash version from
6 to 9 and also to generate AS3 files.
The haXe installation comes with a set of classes that map the original Flash API; because of the big
differences and the incompatibilities between the Flash API for version 9 and the previous ones,
two independent packages with the same flash name have been created.
In this section you will see the main differences in the syntax used in ActionScript (AS) and haXe. You ??™ ll
also see how the Flash API has been adapted to the haXe environment.
Data Types
In AS2, variables are generic containers that can accept any kind of value; in AS3 and haXe, variables
are strictly typed and so their values cannot be changed to another kind unless properly cast or
converted; but they also provide a generic type that accepts any kind of value: Object for AS3 and
Dynamic for haXe.
Pages:
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666