1088 ActionScript classes
To avoid name collisions, Flash looks at the location of the SWF file that is creating the shared
object. For example, if a SWF file at www.myCompany.com/apps/stockwatcher.swf creates a
shared object named
portfolio
, that shared object does not conflict with another object
named
portfolio
that was created by a SWF file at www.yourCompany.com/photoshoot.swf
because the SWF files originate from different directories.
Although the
localPath
parameter is optional, you should give some thought to its use,
especially if other SWF files need to access the shared object. If the data in the shared object is
specific to one SWF file that will not be moved to another location, then use of the default
value makes sense. If other SWF files need access to the shared object, or if the SWF file that
creates the shared object will later be moved, then the value of this parameter affects whether
any SWF files are able to access the shared object. For example, if you create a shared object
with
localPath
set to the default value of the full path to the SWF file, then no other SWF
file can access that shared object. If you later move the original SWF file to another location,
then not even that SWF file can access the data already stored in the shared object.
You can reduce the likelihood that you will inadvertently restrict access to a shared object by
using the
localpath
parameter. The most permissive option is to set the
localPath
parameter to "/", which makes the shared object available to all SWF files in the domain, but
increases the likelihood of name collisions with other shared objects in the domain. More
restrictive options are available to the extent that you can append the
localPath
parameter
with folder names that are contained in the full path to the SWF file; for example, your
localPath
parameter options for the
portfolio
shared object created by the SWF file at
www.myCompany.com/apps/stockwatcher.swf are: "/"; "/apps"; and "/apps/
stockwatcher.swf". You need to determine which option provides optimal flexibility for your
application.
When using this method, consider the Flash Player security model:
■
You cannot access shared objects across sandbox boundaries.
■
Users can restrict shared object access via the Flash Player Settings dialog box, or the
Settings Manager. By default, shared objects can be created up to a maximum of 100K of
data per domain. Administrative users and users can also place restrictions on the ability to
write to the file system.
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...