I'm planning to develop a visual novel in Haxe Flixel and wanted to know if there is a easier way to add dialogue than to hardcode them in every square. I don't know if I can import a txt file with the dialogues or something like that so I can simple change the txt file instead of have to check the code for every typo.
You'd better use a script engine to do that. There are plenty of script engines in Flash AS3, but for Haxe, all I know is hscript. However, hscript doesn't have the handy ability to suspend in the middle of the scripting, which I think is very important in your case.
So you may need to find a script engine in Haxe that can suspend in the middle of its scripting like the BISE engine in AS3, or write your own in Haxe (Although I'm forking hscript to support that feature, I'm not sure when it'll be ready for a release), or switch to AS3 and use BISE.
openfl.Assets.getText("assets/dialogs/exampleDialog.txt"); should do the trick.
Gama11's method is the one I would use personally. Basically you put all of your text inside a text file dialog.txt and split each dialog up with some special character or character sequence (i.e. @@).
------ dialog.txt ------
This is dialog for box 1.@@ Dialog for box 2.@@ And so on...@@
inside of your game use the following:
var dilog_boxes:Array<String> = openfl.Assets.getText(AssetPaths.dialog.__txt).split("@@");
now all you need to do is access the array for each specific block you need. If you need text for block 1, use dialog_boxes, block 2 is dialog_boxes, etc.