0 Replies Latest reply on Nov 2, 2007 12:58 PM by markledford

    LoaderContext checkPolicyFile and checking ChildAllowsParent

    markledford Level 1
      i'm running a dynamic proxy script that only loads images through a proxy if a policy file is not found for the image or does not give permission to access its bitmapdata.

      It is running smoothly except that I am unable to check if the policyfile was loaded (via childAllowsParent) until the image dispatches a complete event. So I have to completely download the image twice in this case, which is horrible.

      In the flex docs: http://livedocs.adobe.com/flex/201/langref/flash/system/LoaderContext.html it states:
      >> However, once the LoaderInfo object dispatches a ProgressEvent.PROGRESS or Event.COMPLETE event, you can test whether a relevant policy file was found by checking the value of the LoaderInfo.childAllowsParent property.

      But i'm finding loaderInfo.childAllowsParent throws Error: Error #2099: The loading object is not sufficiently loaded to provide this information.
      at flash.display::LoaderInfo/get childAllowsParent() if I try to check the policy during the progress events which seams to make the docs incorrect?

      Does anyone have a workaround or feedback on this issue? When you specify to check for a policy file via LoaderContext the docs state that the policy file is checked/completely downloaded before the image is even queried for so it should be reasonable to expect to be able to check if it was successful or not before downloading the file :(