Yes, and yes.
See here.
See here (note the example here is written in ActionScript 3.0, so adjust to Haxe needed):