At 2/8/14 04:07 AM, kkots wrote:At 2/7/14 10:03 PM, slugrail wrote: Yes, but if I format the code in FD with my code indent settings it'd be squashed into one line.Not sure if I understand this. What do you want to say by that? It's my code's fault or your settings are bad?
My point being: use XML, JSON or any human readable, widely know and parsable format. I'm sure you know the use for a programming language is to get human readable, written code and translate it into binary operations for the runtime. Why do you think all these game devs use config files for? You don't write human readable pieces in a file that will be translated into bytes for a machine... you write human readable pieces in a human readable file for humans. There's no reason why you shouldn't be using XML especially when XML is a part of AS3's syntax (I'm not saying you should do what you're doing at current but in XML.. just saying your compiled code should always be separated from config files). And JSON, nobody can forget about JSON, especially not in an ECMA language subset.
So you mean that I should instead write large chains of if/else, where I check what phrase is currently displaying and run code depending on what phrase that is?3) Is it OK to create anonymous functions like this?No and no. Integrate what you'll be commonly using into the dialogue system.
No need for callbacks when you set the boundaries yourself.
No I did not say what you're probably thinking of doing. If, for example your callbacks set within "onHide" are going to hide the dialogue box countless times then you've already broken the most important use for OOP languages, to eliminate ______. Your system should meet your needs for a usable dialogue system. If your dialogue system needs to be told what to do once a dialogue has opened/closed then that's a big case of re******cy you've got there *unnecessary censorship* and that's a great example of a flawed system. Your dialogue system needs to have a boundary; if your onShow callback can send a HTTP request to my site, then you're obviously doing something wrong.
If I use JSON, I will then be able to easily read the data using a program, and do operations with it, like overwriting the file with modified version of it? This is interesting, but it requires a dialogue editor, which I can't afford to produce.
JSON.parse(string) seems easy enough for me... and...
what are you trying to say?