1 Reply Latest reply on Apr 14, 2009 10:18 AM by john isaacks

    Cross Domain issue with images

    john isaacks Level 1

      I have an image tag <mx:Image/> that I am setting the source to product images. The .swf is on the http side of the website and the images are on the https side. Thus I am getting this error:

       

      SecurityError: Error #2122: Security sandbox violation: Loader.content: http://www.MYDOMAIN.com/Masonic.swf cannot access https://www.MYDOMAIN.com/masonic_images/13_red_d2-MAS72479bl_red.jpg. A policy file is required, but the checkPolicyFile flag was not set when this media was loaded.

      at flash.display::Loader/get content()

      at SmoothImage/http://www.adobe.com/2006/flex/mx/internal::contentLoaderInfo_completeEventHandler()

      I don't know how to set the cross-policy flag on an Image component. Also I googled how to set up a cross-domain-policy file and I found a tutorial that said to add this:
      var context:LoaderContext = new LoaderContext();
      // set the check policy flag in the loader context
      context.checkPolicyFlag=true;
      loader.load(request,context);
      But Flex builder is giving me 2 errors for this, a call to an undefined property checkPolicyFlag with static class LoaderContext, and that loader.load expects no more than 1 arg.
      So can someone please tell me what to do so that I can display images from the secure side?
      THANKS!!!