2 Replies Latest reply on Jul 27, 2008 2:40 PM by ZeDav

    Trying to load an external image, got error 2122 Security violation

    ZeDav Level 1
      So I'm making a simple application that allows people to either upload their images or choose some from the web, and let them edit the pictures in a Flex application.

      I have a problem when picking an image from the web, note that is an image from a server that for which I don't control the crossdomain.xml. Basically I get the URL in a textinput, then I create an URLRequest, then a Loader.

      However loaderInfo.content is not available, when I try accessing it, I get a 2122 security error.

      I've been reading the documentation over and over and I must be misunderstanding it because it seems to indicate that such a trivial task is not allowed and not possible. However It works perfectly well (meaning I can access the images) when I debug it on my local computer, the security problem only arises when I make a release and put it on my website.

      Can someone please give me a hint on what I am doing wrong ?
        • 1. Re: Trying to load an external image, got error 2122 Security violation
          Level 7

          "ZeDav" <webforumsuser@macromedia.com> wrote in message
          news:g6hmo9$nj3$1@forums.macromedia.com...
          > So I'm making a simple application that allows people to either upload
          > their
          > images or choose some from the web, and let them edit the pictures in a
          > Flex
          > application.
          >
          > I have a problem when picking an image from the web, note that is an image
          > from a server that for which I don't control the crossdomain.xml.
          > Basically I
          > get the URL in a textinput, then I create an URLRequest, then a Loader.
          >
          > However loaderInfo.content is not available, when I try accessing it, I
          > get a
          > 2122 security error.
          >
          > I've been reading the documentation over and over and I must be
          > misunderstanding it because it seems to indicate that such a trivial task
          > is
          > not allowed and not possible. However It works perfectly well (meaning I
          > can
          > access the images) when I debug it on my local computer, the security
          > problem
          > only arises when I make a release and put it on my website.
          >
          > Can someone please give me a hint on what I am doing wrong ?

          http://xmlrpcflash.mattism.com/proxy_info.php


          • 2. Re: Trying to load an external image, got error 2122 Security violation
            ZeDav Level 1
            Excellent solution. Thanks for your help it addresses my concerns.
            It's too bad there's no way to do that directly in Flex without having to create a php proxy.

            One more comment on php proxies: they're not secure.
            Basically anyone could just point to the php proxy script and use it as a proxy for their own advantage.

            In the end, I modified the PHP proxy script to have it exchange data in an encrypted form with Flex.