3 Replies Latest reply on Apr 18, 2007 3:04 AM by PabIo

    FLash CS3 / Action Script 3.0

    PabIo
      If you use BitmapData.draw() to draw a copy of a movie clip, it wont work when the movie clip has an image loaded from a domain different than the one where the movie is located (a cross-domain).

      This prevents you from both smoothing and making copies of external domain images (smoothing is necessary when you want to scale the image and copying is also important if you want to save BW when reusing the image)

      There is a workarround using a server side script, but this won't work for me :(

      Does anybody knows whether Action Script 3.0 solves that ¿bug? with BitmapData.draw() ????? And if it does, would it work with the swf published for flash player 8 (I suppose no...)?
        • 1. Re: FLash CS3 / Action Script 3.0
          Level 7
          For a crossdomain image to work with BitmapData.draw(), the external domain
          would need to have a crossdomain.xml policy file file granting permission to
          your domain for access of the image. Then, in ActionScript 3.0 in the
          load() method, you need to make sure you supply a LoaderContext object that
          specifies checkPolicyFile as true (by default policy files are not checked
          to reduce bandwidth).

          "PabIo" <webforumsuser@macromedia.com> wrote in message
          news:f028kk$p5d$1@forums.macromedia.com...
          > If you use BitmapData.draw() to draw a copy of a movie clip, it wont work
          > when
          > the movie clip has an image loaded from a domain different than the one
          > where
          > the movie is located (a cross-domain).
          >
          > This prevents you from both smoothing and making copies of external domain
          > images (smoothing is necessary when you want to scale the image and
          > copying is
          > also important if you want to save BW when reusing the image)
          >
          > There is a workarround using a server side script, but this won't work for
          > me
          > :(
          >
          > Does anybody knows whether Action Script 3.0 solves that ¿bug? with
          > BitmapData.draw() ????? And if it does, would it work with the swf
          > published
          > for flash player 8 (I suppose no...)?
          >


          • 2. Re: FLash CS3 / Action Script 3.0
            Level 7
            For a crossdomain image to work with BitmapData.draw(), the external domain
            would need to have a crossdomain.xml policy file file granting permission to
            your domain for access of the image. Then, in ActionScript 3.0 in the
            load() method, you need to make sure you supply a LoaderContext object that
            specifies checkPolicyFile as true (by default policy files are not checked
            to reduce bandwidth).


            "PabIo" <webforumsuser@macromedia.com> wrote in message
            news:f028kk$p5d$1@forums.macromedia.com...
            > If you use BitmapData.draw() to draw a copy of a movie clip, it wont work
            > when
            > the movie clip has an image loaded from a domain different than the one
            > where
            > the movie is located (a cross-domain).
            >
            > This prevents you from both smoothing and making copies of external domain
            > images (smoothing is necessary when you want to scale the image and
            > copying is
            > also important if you want to save BW when reusing the image)
            >
            > There is a workarround using a server side script, but this won't work for
            > me
            > :(
            >
            > Does anybody knows whether Action Script 3.0 solves that ¿bug? with
            > BitmapData.draw() ????? And if it does, would it work with the swf
            > published
            > for flash player 8 (I suppose no...)?
            >


            • 3. Re: FLash CS3 / Action Script 3.0
              PabIo Level 1
              Thx for your reply!

              Then, there is no solution if you want to load external images from any domain (choosen by the movie user) and scale&smooth or duplicate them, isn't it?