13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Security<br />

You can use the SoundMixer.areSoundsInaccessible() method to find out whether a call to the<br />

SoundMixer.stopAll() method would not stop all sounds because the sandbox of one or more sound owners is<br />

inaccessible to the caller.<br />

Calling the SoundMixer.stopAll() method stops those sounds whose owner sandbox is the same as that of the caller<br />

of stopAll(). It also stops those sounds whose playback was started by SWF files that have called the<br />

Security.allowDomain() method to permit access by the domain of the SWF file calling the stopAll() method.<br />

Any other sounds are not stopped, and the pres<strong>en</strong>ce of such sounds can be revealed by calling the<br />

SoundMixer.areSoundsInaccessible() method.<br />

Calling the computeSpectrum() method requires that every sound that is playing be either from the same sandbox as<br />

the object calling the method or from a source that has granted permission to the caller's sandbox; otherwise, a<br />

SecurityError exception is thrown. For sounds that were loaded from embedded sounds in a library in a SWF file,<br />

permission is granted with a call to the Security.allowDomain() method in the loaded SWF file. For sounds loaded<br />

from sources other than SWF files (originating from loaded mp3 files or from video files), a URL policy file on the<br />

source server grants access to data in loaded media.<br />

For more information, see “Author (developer) controls” on page 1043 and “Website controls (policy files)” on<br />

page 1040.<br />

To access sound data from RTMP streams, you must allow access on the server. Use the Server-Side ActionScript<br />

Cli<strong>en</strong>t.audioSampleAccess property to allow access to specific directories on Flash Media Server. For more<br />

information, see the Server-Side ActionScript Language Refer<strong>en</strong>ce.<br />

Accessing video data<br />

Flash Player 9 and later, Adobe AIR 1.0 and later<br />

You can use the BitmapData.draw() or BitmapData.drawWithQuality() method to capture the pixel data of the<br />

curr<strong>en</strong>t frame of a video. (The drawWithQuality method is available in Flash Player 11.3 and higher; AIR 3.3 and<br />

higher.)<br />

There are two differ<strong>en</strong>t kinds of video:<br />

Video streamed over RTMP from Flash Media Server<br />

Progressive video, which is loaded from an FLV or F4V file<br />

To use the draw methods to extract run-time graphics from RTMP streams, you must allow access on the server. Use<br />

the Server-Side ActionScript Cli<strong>en</strong>t.videoSampleAccess property to allow access to specific directories on Flash<br />

Media Server. For more information, see the Server-Side ActionScript Language Refer<strong>en</strong>ce.<br />

Wh<strong>en</strong> you call a draw method with progressive video as the source parameter, the caller of the method must either<br />

be from the same sandbox as the FLV file, or the server of the FLV file must have a policy file that grants permission<br />

to the domain of the calling SWF file. You can request that the policy file be downloaded by setting the<br />

checkPolicyFile property of the NetStream object to true.<br />

Last updated 6/6/2012<br />

1056

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!