Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flash function overloading in Haxe

I am having some trouble figuring out how to overload a function in Flash using Haxe. I know that Flash does not allow overloads but can accept function parameters without a type declared, but I am unsure as how to replicate this trick in Haxe.

EDIT: Since this does not appear to be possible, are there any known tricks that can be used to get around this limitation?

like image 533
Voxl Avatar asked Sep 11 '26 22:09

Voxl


2 Answers

The Haxe website has an example of how to achieve this here: http://old.haxe.org/ref/optional_args

I don't think haxe supports true method overloading... not sure though. Good luck!

like image 90
heavilyinvolved Avatar answered Sep 13 '26 11:09

heavilyinvolved


There was recently a discussion about this on the Haxe mailinglist: http://lists.motion-twin.com/pipermail/haxe/2010-May/035650.html

The most pertinent post is by Haxe's author: http://lists.motion-twin.com/pipermail/haxe/2010-May/035659.html

The tl;dr version is because Flash 9 doesn't support it they removed the ability to do it for all platforms.

like image 38
aerique Avatar answered Sep 13 '26 12:09

aerique



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!