Join Todd Perkins for an in-depth discussion in this video Defining conditional statements, part of Flash CS4 Professional: Object-Oriented Programming .
Conditional statements in ActionScript 3.0 are pretty similar to conditional…statements in just about any other programming language. Let's go to the first…keyframe in the Action layer, and we will open up the Actions panel to create a…similar if statement. An if statement in ActionScript is created by typing the…word if, parenthesis and some curly braces. If the condition inside the…parenthesis is true, then the block of code in the curly braces will run.…So we will do a simple if statement to start out. We will do if (4 > 3), so if…4 is greater than 3, which is true. Then we are going to trace condition is…true. So in that parenthesis I'm going to type some quotes and then I'm going…to type the String, condition is true! Test the movie, and you should get…condition is true in the Output window.…
If I change that greater than sign to a less than sign to make the condition…false and test the movie, I get nothing in the Output window. Now if you want…to run a block of code, if this condition were false, then you can use…
- Loading external text, images, and XML files
- Creating essential properties for a View class
- Defining a Model class
- Building and implementing interfaces and designs
- Debugging projects
- Building applications with Controller-class buttons
Skill Level Intermediate
1. ActionScript 3.0 Essentials
2. Advanced ActionScript Techniques
3. Object-Oriented Programming Fundamentals
4. The Model View Controller Design Pattern
5. Building a Model Class
6. Building a View Class
7. Building a Controller Class
8. Improving and Debugging the Application
9. Moving Forward
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.