Protectobject() - MACROMEDIA FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE Reference

Server-side actionscript language reference
Table of Contents

Advertisement

protectObject()

Availability
Flash Media Server 2.
Usage
protectObject(userObj)
Parameters
An object to wrap in a C wrapper object.
userObj
Returns
An object.
Description
Method (global); protects user-defined or built-in objects behind a C wrapper object. The
methods of any object that has been passed to the
function become system
protectObject()
calls because application code can never access or inspect the methods directly —only through
the wrapper. You can only use this function in the secure.asc file.
Flash Media Server 2 has two script execution modes: secure and normal. In secure mode,
only the secure.asc file (if it exists) is loaded and evaluated—no other application scripts are
loaded. Also, the global
and
functions are only available in
getGlobal()
protectObject()
secure mode. These are very powerful because they provide complete access to the script
execution environment and let you create system objects. Once the secure.asc file is loaded,
the server switches to normal script execution mode until the application is unloaded.
After an object is protected, you must make sure it isn't directly accessible; don't reference it in
global variables or make it a member of an accessible object. The wrapper object returned by
the
call dispatches all method invocations to the underlying user object
protectObject()
but blocks access to member data. As a result, you can't enumerate or modify members
directly. The wrapper object keeps an outstanding reference to the underlying user object,
which ensures that the object is valid. The wrapper follows normal reference rules and exists
while it is referred to.
For more information, see "Implementing secure system objects" in Developing Media
Applications.
112
Server-Side ActionScript Language Reference

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MEDIA SERVER 2-SERVER-SIDE ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash media server 2

Table of Contents