Not 100% sure what you're asking for, but you could make that shorter like this.
var officers = Engine.engine.getGameAttribute("Officers");
if(officers.length == 0)
{
officers.push(["Captain Braggart", 1, 0]);
}
It's possible that could fail to compile because of Haxe's type system, in which case you might need to explicitly define types to let it compile.
var officers:Array<Dynamic> = Engine.engine.getGameAttribute("Officers");
if(officers.length == 0)
{
var newOfficer:Array<Dynamic> = ["Captain Braggart", 1, 0];
officers.push(newOfficer);
}
You can see what the code you originally posted is actually doing by viewing the engine source code at Stencyl/plaf/haxe/lib/stencyl/1,00. If you add that as a folder to sublime text or atom or another coding text editor, you can get an easy way to jump between files. (I can press ctrl + p in sublime text and type in "Engine" to bring up the source code for the Engine class.)