Basic Lesson 1: Publish
Basic Lesson 2: Movie Size
Basic Lesson 3: Action Menu
Basic Lesson 4: Timeline

Basic Lesson 5: Import Image

Lesson 1: Motion Tween

Lesson 2: Shape Tween
Lesson 3: Break Apart
Lesson 4: Motion Guide
Lesson 5: Alpha Fade
Lesson 6: Drag & Drop
Lesson 7: Animated Button
Lesson 8: Load Movie

Lesson 9: Link URL

Lesson 10: Cursor Change
Lesson 11: Add Favorites
Lesson 12: Add Sound
Lesson 13: Insert Scene
Lesson 14: Goto Frame

Lesson 1: Control Movieclips
Lesson 2: Flip Symbol
Lesson 3: Inside Movieclip
Lesson 4: Dynamic Text
Lesson 5: Random Clip
Lesson 6: Actionscript Music
Lesson 7: Symbol Timer
Lesson 8: Rotate Movieclip
Lesson 9: Disable Right-click
Lesson 10: Frame Names
Lesson 11: Side Scroller
Lesson 12: Increasing Velocity
Lesson 13: Visibility
Lesson 14: What's 'this'
Lesson 15: Collectable Items
Lesson 16: Specified Action
Lesson 17: Button Tap Code
Lesson 18: Random in Detail
Lesson 19: Health Bar
Lesson 20: Follow Movieclips

Common Arrays
Lesson 1: Hello World

Lesson 2: Functions
Lesson 3: Loops
Lesson 4: If Statements
Lesson 5: Arrays
Lesson 6: Control Movieclips
Lesson 7: Basic Properties
Lesson 8: Control Movieclips 2

Lesson 9: Adding A Timer

Lesson 10: Saving Data
Lesson 11: Data Objects

Lesson 1: Movement

Lesson 2: Wall Collision
Lesson 3: Shoot
Lesson 4: Shot Collision
Lesson 5: Score

Lesson 1: Character

Lesson 2: Eye Movement
Lesson 3: Arm Movement
Lesson 4: Walking
Lesson 5: Background
Lesson 6: Loop Background

Lesson 1: Orbital Dots 1

Lesson 2: Orbital Dots 2
Lesson 3: Spinning 1
Lesson 4: Spinning 2
Lesson 5: Easing Spaceship
Lesson 6: Sprite 3d
Lesson 7: Bouncy Ball
Lesson 8: Bouncy Ball 2
Lesson 9: Simple Collision

Lesson 10: Crazy Tiles


Contact Flashcartoons!
Click Here to Visit!
Naruto Blogs Forum!
AssCastle - Online Comic
Eddsworld! MyAnimeSpace - Myspace Layouts

Flashcartoons on Facebook

Flashcartoons Google+ Page

Flashcartoons on Twitter

Flashcartoons on Myspace

eXTReMe Tracker


home > learn flash > actionscript 3.0 lesson 3  

 Actionscript 3.0 Lesson Three: Loops

1.)Loops are a way of repeating commands. You can tell a program to repeat a function, increase a variable several times, or something simple as tell the program to do anything several times. Here is an example. You can test by pasting the code into a frame of an actionscript 3.0 document.

--------- --------------

--------- --------------

2.) Here is the code;

var myString:String = "repeat";
for(var a:int = 0; a < 10; a++){

You can tell the program. How many times you want the program to loop though. There are other ways to program a loop. Such as using a "while function", or a "do" statement... A while function requires if statements and I will show you how to program those later on. A do loop requires you to have an array. I will also show you how to program Arrays later on. Ok here is the break down of a for loop. First you must tell the program what kind of loop this is. Then you must tell the program what kind of variable you are going to count by. In this case I have chosen an int type. Then part 2 requires you to tell the program how many times you are going to loop it though, in this case I have chosen (while the int is less than 10). Then the third statement tells the program what to count by. In this case I have chosen to add 1 incriment each time the program has looped through. The Next Part is to add the opening and closing braces, and inside the opening and closing braces is what is going to be looped through. In this case I have chosen a trace statement of the variable myString.



Property Management in Orlando