Intro to ActionScript
From MySLife DAS Wiki
|
Topic Assignments
Watch this video on "ActionScript 2.0" to learn what is ActionScript all about; Learn how write ActionScript code and where to put it in your Flash game.
The ActionScript window is intended for the input of ActionScript code into your game. Press the F9 key to open this window in Flash.
Learn how to Change the Values of Variables in Scuba Diver Tutorial.
- One variable holds one thing
- Holds value
- Number, ground of letters(string)
- Address to a table, object
- Address to something such as a MovieClip or a button
- var <name>;
- ending will be type of thing it's holding(
- Example
- var healthAmount; //health of the player character
- var blueCowName; //name of the blue cow
- var deadAntCtr; //the number of ants player has stomped
- var ammoCount; //ammo for current weapon
- var currentWeaponName;
- var currentCharacterMC; //movie clip
- var rocketWeaponMC; //movie clip of the rocket weapon
- var bowArrowWeaponMC;
- var playerCharX; //is the x position of player character
- var playerCharY;
- var weaponsArray;
- Bad variable names
- 6*9 (no math operations)
- cow tail (no spaces)
- function (no reserved words used by flash)
- X!**&$* (no special characters other than _)
Adjust the hit area on the frog's tongue in the Fly Catcher Tutorial.
- Assignment Statements
- carSpeed = 5;
- tempSpeed = carSpeed;
- baddieSpeed = tempSpeed + 5;
- carPos = carPos * carSpeed;
- carPosX++;
- carName = "Firecracker";
Learn about Conditional Statements and how to use them.
- Conditionals (if test)
if (carSpeed > 10) {
carSpeed--;
} else {
carSpeed++;
}
Update the Wiki:
- Upload the assets (.SWF and .FLA) you create to your Wiki project page.
Update the Blog:
- Write a Blog post about this topic, share your learning experience!
Related Links and Tutorials
- Browse the MySLife.org Flash Tutorials list for more tutorials, information and links!
Search the Web for more information
Here are some search results on Flash ActionScript programming:
- Google results for "actionscript & introduction & tutorial".
- TeacherTube results for "flash"
- Ask.com results for "actionscript & introduction & tutorial".


Students Contributions
Here are examples of what other students did in this topic. Please add your work to this section.


