setAttributes()
113
Example
After secure.asc is executed, calls to
load()
are directed through the user-defined system call,
as shown in the following example:
var sysobj = {};
sysobj._load = load; // Hide the load function
load = null; // Make it unavailable unpriviliged code
sysobj.load = function(fname){
// User-defined code to validate/modify fname
return this._load(fname);
}
// Grab the global object
var global = getGlobal();
// Now protect our sysobj and make it available as
// 'system' globally. Also, set its attributes
// so that it is read-only and not deletable.
global["system"] = protectObject(sysobj);
setAttributes( global, "system", false, true, true );
// Now add a global load() function for compatibility.
// Make it read-only and non-deletable.
global["load"] = function(path){
return system.load( path );
}
setAttributes( global, "load", false, true, true );
See also
getGlobal()
setAttributes()
Availability
Flash Media Server 2.
Usage
setAttributes(
obj
,
propName
,
enumerable
,
readonly
,
permanent
)