Policy-file-url

From Frontal Wiki

Jump to: navigation, search

Contents

Purpose

Use this style to tell Flash where 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

A URL.

policy-file-url: http://www.flickr.com/resources/policy.xml;


Remarks

The Flash security system is described extensively in the Flash documentation. In particular, refer to Security.loadPolicyFile 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 look for a policy file named crossdomain.xml at the root level of the domain serving the resource. By setting this style to true, though, an alternate policy file name and location may be specified. Note though that the policy file must be at the same level or higher in the URL folder structure of the resource for it to be applied.

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>


Can Be Applied To

This style can be applied to:

Personal tools
Get Adobe Flash player