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.

With over two decades of deep front-end expertise, I offer comprehensive web consultancy and stack audits, alongside specialized workshops, training, and engaging public speaking to elevate your team's skills and optimize your digital presence. Contact me.