The code is correct, but it doesn't really use any of the advantages
Haxe has over AS3. Also you can actually just write
`options.ad_started` if `options` is `Dynamic`.
Most importantly, anonymous objects in Haxe can be strictly typed.
It's not easy to show you this without seeing the whole code, but this
should give you an idea:
public static function showPreGameAd(?options:{?ad_started:Bool,
?clip:MovieClip}):Void {
if (options == null) {
options = { };
}
if (service.showPreGameAd != null) {
service.showPreGameAd(options);
} else {
MindJoltAPI.options = options;
if (options.ad_started) {
options.clip.stop();
}
}
}
While `*` and `Object` are common place in AS3, in Haxe `Dynamic` is
usually a bad sign.
In some cases you will also want to use enums instead of anonymous objects.
Regards,
Juraj