Now, we have a basic conception about the class. We know class defines the abstract characteristics of a thing (object), including the thing’s characteristics (its properties) and the thing’s behaviors (the methods or operations).
Posts Tagged ‘tutorials’
In the last section, we use some code to show the OOP style code. But the code can’t run. In this section, we’ll try to make it run.
Type the example code into your flash authoring tools, and then test it. If you’re using flash cs3, you will get the following result.
When you looking at some resources introducing the ActionScript 3.0, it may say that, “ActionScript 3.0 is an object-oriented programming (OOP) language”. The key word “object-oriented programming (OOP)” is the topic of this article eh, and the following articlesJ.
Function, is a very important concept inside the ActionScript. And we talk a lot about the function in ActionScript 3.0. Let’s review them together now.
At first, we use an example to show you how the functions help you get rid of the redundancy of your code, and make your code easier to maintain.
And then, we discuss what the function is.
For functions, you’ve already know much, today, it’s the last one I want to talk under the function, the nested functions.
Nested functions: ActionScript supports nested function. You can nest functions, which means that functions can be declared within other functions. A nested function is available only within its parent function unless a reference to the function is passed to external code.
When we discussed the variables, I said I want to put the scope topic with the function. Because I think the variables’ scope have much to do with the functions.
Besides the default parameters, there are still some thing you need to know about the parameters in ActionScript 3.0, the Arguments object and the …(rest) parameter.