Check-policy-file

From Frontal Wiki

Jump to: navigation, search

Contents

Purpose

Use this style to tell Flash to look for a policy file when loading an external asset. (Policy files are part of Flash's security system as described in #Remarks.)


Value

Either "true" or "false". The default value is "false" though setting allow-smoothing to "true" on an 'img' tag and not explicitly setting this style to "false" will result in the policy file being checked.

check-policy-file: true;


Remarks

The Flash security system is described extensively in the Flash documentation. In particular, refer to LoaderContext.checkPolicyFile for details. This security system is stricter than that implemented by HTML and JavaScript and allows content providers to have more control of how their resources will be used in Flash movies.

The way a provider controls their content is via things called policy files. These are XML files placed on a web server that say how content retrieved from that web server may be used. For example, let's say an image file is being pulled from a server. How that image may be used may be controlled via a policy file.

By default, Flash will not automatically look for a policy file when loading an external resource. By setting this style to true, though, it will. More over, Frontal will wait until the external asset actually begins loading so as to handle any potential redirects that might affect the location of the policy file as described in the Flash documentation.

When is loading a policy file necessary? The general answer is whenever the content of an external resource must be accessed directly. An example is when setting allow-smoothing to "true" for an 'img' tag. See Permissions and External Assets for more details.

Note that once a policy file is loaded for a domain, it is not loaded again. Therefore, you may also add script like this to load a policy file for a domain from which you are planning to load external resources.

<script><![CDATA[
System.loadPolicyFile ( put the URL of the policy file in quotes here );
]]></script>


Example

First, clear your cache and try this example. Notice how jagged the lines in the image are. This is because the allow-smoothing style is failing because Flash has not granted permission to the image's content.

<img src="http://farm1.static.flickr.com/64/226228060_c88ba6cf6b.jpg" style="scale: 1.4; allow-smoothing: true; check-policy-file: false;" />

Now try the following. Flickr allows access to image content and so if we check the policy file (the default behavior for images with allow-smoothing set to true and check-policy-file not explicitly set to false) then the image smoothing is successful.

<img src="http://farm1.static.flickr.com/64/226228060_c88ba6cf6b.jpg" style="scale: 1.4; allow-smoothing: true;" />


Can Be Applied To

This style can be applied to:

Personal tools
Get Adobe Flash player