We saw in lesson 4 of OOP with Flash CS3, the different type of attributes that we can combine with a property and how to declare them.
The attributes associated to a method are equal of the ones for a property and they have the same characteristics.
An important point is as example:
If we have a class with a property named ‘nome’, we can assign it a private attribute so that no one using our class can access its value and our class can carry out a fixed task without having the property’s functions modified (otherwise the result would be altered).
The problem using the private attribute is that its value would not be available even if we wanted to only retrieve its value and reuse it during the course of developing our application.
To make it accessible without changing its private attribute, we can create a public method (for example: ‘prendiNome’) which once called will retrieve the value of the property ‘nome’.
How?
As the method is placed inside the class (it is one of the class method), it has access to the property ‘nome’.
Let us look at concrete examples…






