Private Statement - MACROMEDIA FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE Reference

Flash lite 2.x actionscript language reference
Hide thumbs Also See for FLASH 8-FLASH LITE 2.X ACTIONSCRIPT LANGUAGE:
Table of Contents

Advertisement

return Math.PI*this.radius*this.radius;
};
this.getDiameter = function() {
return 2*this.radius;
};
this.setRadius = function(param_radius) {
this.radius = param_radius;
}
}
// ActionScript 2.0 code that uses the Circle class
var myCircle:Circle = new Circle(5);
trace(myCircle.getArea());
trace(myCircle.getDiameter());
myCircle.setRadius("10");
trace(myCircle.radius);
trace(myCircle.getArea());
trace(myCircle.getDiameter());
See also
class statement

private statement

class someClassName{
private var name;
private function name() {
// your statements here
}
}
Note: To use this keyword, you must specify ActionScript 2.0 and Flash Player 6 or later in
the Flash tab of your FLA file's Publish Settings dialog box. This keyword is supported only
when used in external script files, not in scripts written in the Actions panel.
Specifies that a variable or function is available only to the class that declares or defines it or to
subclasses of that class. By default, a variable or function is available to any caller. Use this
keyword if you want to restrict access to a variable or function.
You can use this keyword only in class definitions, not in interface definitions.
Availability: ActionScript 2.0; Flash Lite 2.0
Parameters
- The name of the variable or function that you want to specify as private.
name:String
Statements
207

Advertisement

Table of Contents
loading

Table of Contents