0 Replies Latest reply on Aug 4, 2008 11:53 AM by NickKoji

    Sandbox Error: Flaws in my castle!

    NickKoji
      My Error:

      SecurityError: Error #2123: Security sandbox violation: BitmapData.draw: http://207.114.187.192:8080/main.swf cannot access http://mlsimages2.cfwebmasters.com/weichertccresize.asp?provider=BMLS&photo=625558_1.jpg&w idth=640. No policy files granted access.
      at flash.display::BitmapData/draw()
      at mx.effects.effectClasses::MaskEffectInstance/getVisibleBounds()
      at mx.effects.effectClasses::MaskEffectInstance/initMask()
      at mx.effects.effectClasses::MaskEffectInstance/startEffect()
      at mx.effects.effectClasses::ParallelInstance/play()
      at mx.effects::EffectInstance/startEffect()
      at mx.effects::Effect/play()
      at mx.core::UIComponent/commitCurrentState()
      at mx.core::UIComponent/setCurrentState()
      at mx.core::UIComponent/set currentState()


      What I have done:
      1. Created a crossdomain.xml policy:
      <?xml version="1.0" ?>
      <!DOCTYPE cross-domain-policy>
      <cross-domain-policy>
      <allow-access-from domain="*" secure="true" />
      </cross-domain-policy>

      2. Added a context loader to the images:
      [Bindable] var loaderContext : LoaderContext;

      private function imageInit() : void
      {
      loaderContext = new LoaderContext();
      loaderContext.checkPolicyFile = true;
      }
      3. Image Tag:
      <mx:Image width="50" height="50" right="14" top="5" id="detailsImage" initialize="imageInit()" loaderContext="{loaderContext}" click="showFullImage(currentDestination.ImageURL);"/>

      This error is caused when a user clicks a tilelist item to view a details panel. The details panel has a image inside it that when a user clicks it changes the state to full screen the image. the user then clicks the full screen image to return to the details panel but the error pops up! Then once a user clicks another tilelist item to view on the details panel i receive the error even though this error would not pop up if i never changed the state to view the full screen image.