We are in need of a professional AS3 coder to help us with our big project. we will be coding on a team so it’s important to mention some
details:
For a business to be successful, we need to make sure that the team is following the same rules and here I try to explain some of the
important facts that we apply in writting our classes. This does not mean that we know everything about coding and it does not mean that we
are sure this is the best practice neither! As you know, technology in the world is expanding so fast that no one could ever be sure that
they know things better than others but I just tell you the facts that we have been happy with. and it’s very probable that in future, new
rules may be added but as for now, the following structure is the best we have came up with.
To give you a quick insight of the final goal, it’s worth it for you to know that we are going to build up a very big software which will
allow ordinary internet users to build their own flash sites with nice and modern features/tools. and to get to that big dream, we are
building our classes from the very scratch. we have started with some very basic classes like a Bg class, like a button class, like a
scrollbar class… we are also uploading the classes to www.myflashlab.com if you want to have a look at their demo.
take the scrollbar class as an example: http://www.myflashlab.com/2010/01/22/scrollbar-class/ as you see, although this is a scrollbar, but
it’s very complex, almost perfect. it does almost EVERYTHING you might want a scrollbar to do!
Here are the points you need to know:
1) we code AS3 with the help of the free software “FlashDevelop”. not because it’s free but because it gives us a lot of nice features that
FLash IDE doesn’t. Besides that, it will help us easilly use the SVN in our internal network. you must know how to code in FlashDevelop and
how to work with SVN, we’re using “TortoiseSVN”.
2) we use Flex SDK for compiling the codes, currently we are using “flex_sdk_4.0.0.6898″.
3) we carefully write comments for asDoc generator so we can generate html documentations for every class we finish.
4) we write our code with a very careful look at CPU usage because these classes will be all used together in future and if we want the
final product to run smoothly using hundereds of these classes, we must be sure that all small classes are working smooth without using
unnecessarilly cpu. To manage this, we must use the common logic and make sure the class is not doing something unnecessary operations…
just as a simple and quick example, we don’t want to have a Event.ENTER_FRAME to be always running. it just need to work when needed and
removed when it’s not necessary. or for example a “for loop” which is trying to find a “Sprite” in the stage must be terminated as soon as
it found the desired result, and many more samples… the main thing is to make classes run as smooth as possible.
5) For almost all our classes, we add “ADDED_TO_STAGE and REMOVED_FROM_STAGE” listeners so we can make sure we are coding clean and if a
small button class is inside a popup class and the popup is removed, we can be sure that the button inside of it will also be removed
completly and no other process will continue silently in the background.
6) We code our classes in a fashion that we have named it “live approach”, by which I mean you can set properties for the class anytime and
they will work instantly. take the scrollbar class as an example, you can change its dimensions or colors, or any other property anytime and
depending on which property is changed, the scrollbar will be changed accordingly.
7) for some of our classes we build an import/export method. this needs a bit more explanation but as a brief, these two methods, will let
you create a new instance of the class and instead of manually setting its properties, you can export properties from a former instance and
then import them into the new instance. For example in our contact form “http://emstris.com/sample/AS3/forms/contactForm/”, we have used the
scrollbar in three different places, but we didn’t want the user to be forced to set properties for all three scrollbar instances manually,
so they set the scrollbar once and then we use the import/export method to set the properties to all other instances of that class.
that’s it for now
I have put a very basic project for you which includes all above explaned rules. that should get you started. all I
want from you is to be able to code nice and clean and as OOP as possible.
If you feel ok with these, let me know in PMB and I will send details for our real project that you’ll be helping us with.
and by the way, please send me your best sample code. only send me one sample, you best one.
Best regards,
Hadi