Questions Answers

[ LiB ]

Questions & Answers


Q. Where can I get a list of all the methods and properties that a Movie Clip can have?


A. The Flash Help file, of course. You can find anything you want in there. Don't forget about it.


Q. I'm still kind of fuzzy on the concept of scope. All this local and global stuff makes me hurl. What can I do?


A. Try using local variables wherever possible. Don't use global variables unless you absolutely have a good reason to do so. The reason I am suggesting this is because having 100 global variables in a game can get messy. It's not the best memory-management way to do things either. When you create a local variable, the space for the data is allocated and then deleted once the variable is out of scope. This is not the case with global variables they stay in memory for the life of the game. Also, make sure you name your global and local variables differently, or else you will have bugs creep up on you.


Q. I'm thinking of setting up a set of functions that I can use and reuse in any project file. Would I have to copy and paste them into every project every time I want to use these functions?


A. No. You can use the #include directive to load in a text file that contains your functions. You can save your code into a regular text file. For self-reference, it is a good idea to add the *. extension so you can be easily understand what's in the file. We will go over this later in the book.

[ LiB ]

Game Development with ActionScript
Game Development with ActionScript
ISBN: 1592001106
EAN: 2147483647
Year: 2004
Pages: 162
Authors: Lewis Moronta © 2008-2017.
If you may any questions please contact us: