1 Reply Latest reply on Jun 19, 2009 3:02 PM by Rothrock

    sharedObject and images


      i have images whuch were loaded into a loader component and i need to use the sharedObject for these inages.

      the tutorials shows only how to shareObjects of text. ineed script for image.

      please help


        • 1. Re: sharedObject and images
          Rothrock Level 5

          I don't think you can realistically do this with AS2. Of course I guess it really depends upon the size of the loaded images.


          You could draw the image to a bitmap (assuming that you aren't loading the images from a cross-domain that you don't have access to) and then use getPixel to get the values, and store them to the SO. Then you could go back the other way to reconstruct the images. It would be pretty slow I think.


          In AS 3 there is the ByteArray class and it is really quick to change a bitmap into a bytearray and you can even use zlib compression to store it in the SharedObject.