author: Krasimir Tsonev

Hi there, I'm . Senior front-end engineer with over 13 years of experience. I write, speak and occasionally code stuff.

checkPolicyFile flag was not set

Sometimes the uploading of crossdomain.xml file is not enough to get the things working.
I just released a site for my client. I uploaded all the stuff on the server including crossdomain.xml file, but the site didn't works with "www". The error that popups was:
A policy file is required, but the checkPolicyFile flag was not set when this media was loaded
So the solution is pass a LoaderContext to your Loader object:
var context: LoaderContext = new LoaderContext();
    context.checkPolicyFile = true;
    var loader: Loader = new Loader();
    var img_url: String = img_src;
    var request_url: URLRequest = new URLRequest(img_url);
    loader.load(request_url, context);
If you enjoy this post, share it on Twitter, Facebook or LinkedIn. Or maybe comment below: