Set - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

set

Availability
Flash Player 6.
Usage
function set property(varName) {
// 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.
Parameters
Word that refers to the property that
property
the value used in the corresponding
The local variable that sets the value you're assigning.
varName
Returns
Nothing.
Description
Keyword; permits implicit setting of properties associated with objects based on classes you have
defined in external class files. Using implicit set methods lets you modify the value of an object's
property without accessing the property directly. Implicit get/set methods are syntactic shorthand
for the
Object.addProperty()
getter/setter methods" in Using ActionScript in Flash.
Example
The following example creates a Login class that demonstrates how the
to set private variables:
class Login {
private var loginUserName:String;
private var loginPassword:String;
public function Login(param_username:String, param_password:String) {
this.loginUserName = param_username;
this.loginPassword = param_password;
}
public function get username():String {
return this.loginUserName;
}
public function set username(param_username:String):Void {
this.loginUserName = param_username;
}
public function set password(param_password:String):Void {
this.loginPassword = param_password;
}
}
ActionScript Language Reference
will access; this value must be the same as
set
command.
get
method in ActionScript 1. For more information, see "Implicit
CHAPTER 2
keyword can be used
set
set
727

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash mx

Table of Contents