views:

123

answers:

2

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?

+2  A: 

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

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

heavilyinvolved
A: 

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.

aerique
Those posts are not exactly related to what the questions is about. Those posts talk about methods in a subclassing overriding the superclass methods with a different method signature.
davr