Haxe projects usually are compiled with a hxml file, which basically contains compiler arguments. So most of the tricks I am going to show are actually compiler arguments tricks, which may also applicable to nmml file or IDE that does not use hxml (though they should).
Articles with the trick tag
Page 1 / 1
Haxe tips: everything is an expression
In Haxe, nearly everything is an expression. (Things that aren’t: import statement, class declaration etc, which are at module level). And every expression can be evaluated to a value.
A block is an expression that is evaluated to the last expression inside the block:
var v = { //some code 123 …
Haxe tips: Macro-Proxied Class = with macros for compile-time and implementation for run-time
As mentioned in the previous post on overloading, I found a way to provide a reflection friendly, run-time implementation of a
@:macro
method or an extern class. The trick is simple: build the implementation with a@:native
metadata.Here is an implementation of using such I called macro-proxied class in …
Haxe tips: advanced method overloading with macros
The @:overload metadata
Introduced in Haxe 2.08(released in 2011),
@:overload
metadata can be used to annotate a method to have several type signatures. For example, inJQuery
of jQueryExtern, the method “html
” has the following declaration:@:overload(function(valueOrFunction:Dynamic):JQuery{}) public function html():String;
It declares the …
Haxe tips: better untyped expression
tl;dr
Remember to put the brackets
(untyped new JQuery("#images").imageLoader)({}); // ^ ^ // |________these____________________________|
Abstract
Static type system of Haxe helps you a lot by performing type-checking in the compilation phase. You will be notified errors before the application is run.
Since some Haxe targets (e.g.. JS and PHP) are …
How to know objects are really GC’ed in Flash(AS3)
Memory leak is a bug that pretty hard to deal with. Usually people use some profilers to observer the memory usage while stressing the program, if there is no increase of memory usage after repeating calls of a function, we can conclude there is no memory leak in that function …
FLARtoolkit trick: use a colored marker
Reasons why should we use colored marker instead of standard black and white only marker
Using a black and white only marker is boring
There are more and more AR applications in the world, but seems everybody use only the black square marker. May be the public is not yet …
How to hold a key without your hands on a standard keyboard.
Page 1 / 1