I hope this is not another silly question, if so please let me know, I’ll try to deal with it
I’m converting from AS2 to AS3 and on that ocasion from timeline coding to class coding.
I want to build a project, that depending on variuos variables will generate apropiate layout.
Let’s say, I’ll create couple of custom classes and the Main class will be asking some external file if it should use each class.
For example each project will have a file containing:
Logo = “yes”;
LogoPosition = “tl” // Top-left
Then the core code used for every project I’ll make, will ask:
if (Logo == “yes”) {
include logo.as
logo(tl);
}
If the above makes sense what’s the best practice to store each projects’ data (something like configuration data)?
Should it be stored in a class, or should I just include project-specific configuration.as file with list of all variables?
Continuing the thread my project would involve creating main MovieClip where everything will be happening, this MovieClip may vary depending on the variables stored in external file. Let’s say I want to have the code for creating the main MovieClip separate from Main class, I’ve got another question:
What’s the best practice to keep the code for that MovieClip? - should it be stored as a class or just a function (in separate file) called by “include” function? It doesn’t do much, just creating MovieClip based on couple of variables thence my question - still trying to understand what’s best practice to use the classes and avoid wrong way of learning.
Thx a lot for any comments.