Prev | Current Page 674 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


Some methods found in the Flash Date class have been moved to the
DateTools class.
Error
(F6??“9)
haXe permits to throw and catch any type of variable so it is not needed to
implement Error for error handling.
Top - level Classes Replaced by haXe - Specific Types
The top - level classes of the Flash API are located in the flash package. Some of the top - level classes do
not have an equivalent class in haXe. Table 12 - 7 explains how to work around the absence.
Table continued on following page
Part II: Server Side, JavaScript, and Flash: Oh My!
358
ActionScript Class
(Flash Version) haXe Equivalent
Function
(F6??“9)
Functions are not class instances in haXe; nevertheless it is possible to
invoke dynamically a function using Reflect.callMethod() or it is
possible to reassign a function body to an already existing definition.
class Sample
{
public static f9dynamic function hello()
{
return ???hi???;
}
public static function main()
{
trace(Sample.hello());
Sample.hello = function()
{
return ???Hello World!???;
}
trace(Sample.


Pages:
662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686