Showing posts with label Flash. Show all posts
Showing posts with label Flash. Show all posts

Saturday, 16 October 2010

Keyboard Shortcuts Actionscript 3.0 , Flash

We all know that time is important so anything that is available to save time should be used and abused (unless it's a living thing, then you need to make sure that you treat it nicely).
Something that will save your self a lot of time in flash are Keyboard Short-cuts. Instead of going to the tool window to change the tool that you are using a single press of a key can do it for you.
Some of the most useful ones.
  • V: The Selection Tool
  • R: Rectangle Tool
  • O: Oval Tool
  • K: Paint Bucket Tool
  • J: Object Drawing
  • Ctrl + Enter: Render the scene
Over time I will extend this list. Also I when it will be possible I'll also attach a screen shot so it is easier to see what I am talking about.

Currently Listening to The Automatic, Steve McQueen

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

Wednesday, 29 September 2010

Motion Tween, Flash

Learned
Basic Animation in Flash. How to use the Motion Tween.

Key Points to remember:
  • Every sprite that is to be animated needs to have it's own layer.
  • Layers work the same way as they do in Photoshop (the layer at the bottom will be behind the layer at the top).
  • Key point in the animation are marked with "Key Frames". (Say there is a change in direction then a Key Frame will show where it happens)
  • Any item that you would like to Tween needs to be a "Symbol". This is easily done by selecting the item and pressing the "F8" key.
  • Label every thing. You can easily lose yourself amongst all the Key Frames, Layers and Sprites. Meaningful labels/names make life easier for you.
The Motion Tween feature is a very powerful tool in flash. You can use it not just to move Sprites, but also to change it size over time, rotate it on the spot, to fade in and out (like a ghost) or even a combination of all of these things.

How to do a Motion Tween:
  • Select the item you want to Tween. It can be anything as long as it's a symbol (remember the key point above?)
  • Now right click it and select "Create Motion Tween"
  • Move the item to where you would like it to travel.
  • If it worked then you should notice the following.
  1. There should be Green Line on the screen that starts where the Item was and end where you placed the item.
  2. On the time line you'll be at the frame number that is based on your frame rate (Normally 24fps)
  3. Also in the frame you're in there should be a black diamond symbol (this for all extents and purposes is your Key Frame)
  • Did it work? Good. Now to see your work in motion just press the "Enter" key. Or press the button combo of "Ctrl+Enter". The latter is more preferable as it will show you what your audience will see.
Extra Points
  • To start a new Flash File, open Flash and then select "Actionscript 3.0". This will take you to a blank stage for you to tinkle with.
  • When making Sprites make sure you draw it at the size it is intended to be used at. While you can draw one and then shrink it using the free-form tool it will still retain the original data size, which means longer processing time (not fun for any one). Remember you got the Zoom tool. Use it.
  • If you're using a Mac you zoom in on any area on the screen (this applies to anything outside of flash to like Firefox). To do this just hover the Mouse over where you like to zoom to, then hold "Ctrl" and roll in using the roller ball on the mouse. This is handy to show people certain areas that are needed.
  • Say you want to extend a layer so that it can be seen through out the whole animation but you don't want to tween it (e.g back ground). Well this is easily done by selecting the frame in the layer you would it to appear till and then press "F5". You should have a blank Rectangle appear.
  • Just as "F5" adds a normal frame, "F6" adds an extra Key Frame. This is handy to add a little stop gap between an animation that has to processes going on. Let's give an example. You have a fish growing and moving across the screen. But when it reaches the middle you want it to stop growing but keep moving. But after it's past the middle it starts growing again. You'll need an extra Key Frame to handle that. (BTW the fish needed to stop growing to get past the bollards).
  • There are 3 Symbols in the layers box that can become your best friends if you use them properly.
  1. The eye. This makes that Layer invisible or visible.
  2. The Padlock. This locks or locks the layer. Great to avoid unintended movement of Sprites.
  3. The Coloured Box. Super Handy if you learn how to use it properly. When the box has colour in it everything in that layer has it proper fill colour. However when the box just has it's outline then all the items on the layer also only show their outlines. Useful if you want to move something in relation to a sprite on a higher layer. To change the outline colour you just need to double click on the Box.
And that's it for today's lesson. David also recommended to read "Animation With Scripting For Adobe Flash Professional CS5 Studio Techniques". Try and say that after a shot or two. It gives you great tips for Flash animation but remeber that we're on a games design course, so if your money is tight or you not to interested in animation you might want to think about it.
Oh and if you are looking for it check out Amazon here. However when I was on there last they were sold out of first hand ones.

Currently Listening to Fall Out Boy, Disloyal Order of Water Buffaloes