Sunday 3 October 2010

Important things to remember for Actionscript 3.0, Flash

Learned
How to use Actionscript 3.0 to animate a movieclip without the use of Tweening.

Key things to remember
  • Spelling is super important. Just having one letter out of place can spell disaster (like what I did?) to any programming you do.
  • When labelling anything use camelCase. Basically if you take and put words together the first word is has a lower case for the first letter while all the over words have a Capital letter for the first one. aBitLikeThis.
  • Actionscript is added to a frame. To make life easy and to find the coding easily put it on it's own layer and lock the layer (remember the padlock symbol).
  • When ending any line of coding in Actionscript (and most programming languages) use ";".
  • To leave any comments in Actionscript use "//". Always, always, ALWAYS leave comments. Even if you do that line of code all the time. All it takes is a break of a couple of weeks and you'll forget what it meant. Also if you are doing group work another person may not know what you were doing.
  • The co-ordinates in Flash are slightly different to what they are from Maths in secondary school. The X axis remains the same but the Y axis instead of going up, goes down.
  • When you convert an item to a symbol take note of where the Registration is. That black square is consider the centre of the symbol. So if you where to rotate it, it would rotate around the black square is meant to be. Most of the time you will have it in the middle.
Now to understand Flash you need to be logical. If you're not then you may find it hard to do. But have no fear. Logic is easy to train. My personal preference for training is Sudoku. You don't need maths skills (well you need to be able to count from 1 to 10 so that's a little lie) and it's easy to learn.

Extra Points
  • There is a super handy thing that Flash CS5 can do for you. Predictive coding. Just like Predictive Text on you're mobile phone Predictive coding tries to guess what property you are writing and also other things to. There is a slight catch however. You have to set it up first for it to work. It's easy to set up just type in the following line of code
[ var instanceName :MovieClip;]
  • Whenever I'm typing any coding to make sure it sticks out from normal text I'll enclose it in []. These block heads are not part of the coding. Also anything in italic is a name that will depends on what you as the programer will chose. Once I have Flash and can take screen shots it will be easier to understand what I'm doing.
  • Many people would say that it's not worth the effort to do the above coding just to get a little bit of Predictive Coding but one VERY important factor that it does cover is spelling. As mentioned eariler one single spelling mistake can cause a mass of issues for yourself. So play it safe and do the above line of code in any bit of programing you do.
Currently Listening to Marron 5, Not Falling Apart

No comments: