LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


Prev Previous Post   Next Post Next
  #1  
Old 06-12-2004, 08:28 AM
FrozenMedia's Avatar
FrozenMedia FrozenMedia is offline

Frozen Moderator
 
Join Date: Apr 2003
Location: United Kingdom
Posts: 2,701
Rep Power: 13
FrozenMedia is on a distinguished road
How do you eat yours?

I was staring at a lot of code last night and thinking, how is everyone dealing with AS2?

By this I mean, we are all coming from different backgrounds, personally I've taken the C route and stayed fairly procedural until the last couple of years, but others have come from C++ and Java and brought with them many OO practices.

The question is, when it comes to coding, what's your style? I hope this proves to be of interest to others like me, curious of "what is the best way to code in AS2?"....

Here's my answer to kick things off (if it's bad, just tell me I won't be mad !):

- I always no longer use "this" (as in AS2 it is implicit as in Java) to access properties in a class as I feel it is still easily readable if the classes are abstracted enough. (Not sure if there are speed issues as with _global?). Obvious exceptions to the rule are when the method parameter has the same name as a class's property, this.property = property; then works great

- I place all public and private properties at the start, before the constructor. (This seems to contradict MM's latest classes, such as Remoting AS2)

- I only use getter/setter methods when something else (other than getting/setting) is done within the method.

- I always use _array _mc etc to speed up my coding by 2x


I've noticed on recent MM code the complete reverse is for that first point, Any comments?

If this even get's 1 reply, that will be great!!
Rich

* Also with games, how do you set yours up? I like to create a Game class extending MovieClip that has an onEnterFrame loop check the "gameState" every frame with a switch statement and call the relevant methods based on the state, e.g. Logic/Move/Render...
__________________
Blog: http://www.richardleggett.co.uk | If your happy with the help, let us know about it
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eat 3D m. allen west 3D Programming 1 05-21-2009 11:45 AM
asp problems havey Server Side 3 01-14-2004 01:00 PM
eat this!! veejay Cool Sites 3 01-19-2001 10:43 AM




All times are GMT. The time now is 06:13 AM.