User Guide
Accessing loaded media as data 475
When you load the image using the load() method of the Loader class, you can specify a
context parameter, which is a LoaderContext object. If you set the checkPolicyFile
property of the LoaderContext object to
true, Flash Player checks for a cross-domain policy
file on the server from which the image is loaded. If there is a cross-domain policy file, and the
file permits the domain of the loading SWF file, the file is allowed to access data in the
Bitmap object; otherwise, access is denied.
You can also specify a
checkPolicyFile property in an image loaded via an <img> tag in a
text field. For details, see “Loading SWF files and images using the <img> tag in a text field”
on page 469.
Accessing sound data
The following sound-related ActionScript 3.0 APIs have security restrictions:
■ The SoundMixer.computeSpectrum() method—Always permitted for SWF files that
are in the same security sandbox as the sound file. For files in other sandboxes, there are
security checks.
■ The SoundMixer.stopAll() method—Always permitted for SWF files that are in the
same security sandbox as the sound file. For files in other sandboxes, there are security
checks.
■ The id3 property of the Sound class—Always permitted for SWF files that are in the same
security sandbox as the sound file. For files in other sandboxes, there are security checks.
Every sound has two kinds of sandboxes associated with it—a content sandbox and an owner
sandbox:
■ The origin domain for the sound determines the content sandbox, and this determines
whether data can be extracted from the sound via the
id3 property of the sound and the
SoundMixer.computeSpectrum() method.
■ The object that started the sound playing determines the owner sandbox, and this
determines whether the sound can be stopped using the
SoundMixer.stopAll() method.
When you load the sound using the
load() method of the Sound class, you can specify a
context parameter, which is a SoundLoaderContext object. If you set the checkPolicyFile
property of the SoundLoaderContext object to
true, Flash Player checks for a cross-domain
policy file on the server from which the sound is loaded. If there is a cross-domain policy file,
and the file permits the domain of the loading SWF file, the file is allowed to access the
id
property of the Sound object; otherwise, it will not. Also, setting the
checkPolicyFile
property can enable the
SoundMixer.computeSpectrum() method for loaded sounds.