Join Todd Perkins for an in-depth discussion in this video Setting values for properties, part of Flash CS4 Professional: Object-Oriented Programming .
- View Offline
- Exercise Files
Now we will add some more methods and set values for some of the properties in…our Model class. I'm going to scroll down in my code to the dataLoaded…function and below the code that's already in there, I'm going to write a…function that we have to define yet called setCurrentIndex. I'm going to…pass in a value of currentIndex. currentIndex is a property here that we have…defined at the top of the code. It's initialized to zero. Now let's define the…setCurrentIndex method.…
I will do that right above the dataLoaded method. This is going to be public,…so public function setCurrentIndex. It's going to receive a parameter called index, …which will have data type of integer. We'll have it return void and…type some curly braces there.…Now we will define what happens inside of this method. First, we will set the…value of currentIndex equal to whatever value is passed in through the index…property. So currentIndex = index.…
Next, we will run some methods that we will define later. First we will run…
- 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.