2 Replies Latest reply on Aug 23, 2006 4:17 AM by

    Load images in runtime

      Hi.
      I am trying to create empty movieClips in runtime and load images to them. My problem is that it results in some performence problem.

      The thing is that I load images from a digital camera and each image is about 1MB. First of all, that takes a long time to load. Then i change the _x/_y scale so that the images becomes thumbnails. (Does the image remain 1MB when i use scale, or does Flash make the filesize smaller?)

      Next problem is that i want to use "duplicateMovieClip" on those thumbnails and start drag the copy. It doesn't seems to work with "duplicateMovieClip" on dynamic created mc so I need to make a new emptyMC and load the image into it. That takes about a second.

      Is it possible to create a movieClip to the library in runtime and then use attachMovie() for every new instance that i want to create?

      I hope you understand my problem.
      /Antewik
        • 1. Re: Load images in runtime
          blemmo Level 1
          Hi,

          > (Does the image remain 1MB when i use scale, or does Flash make the filesize smaller?)

          It's the same picture, just scaled down, so it will remain 1 MB. Maybe there are thumbnail versions stored in the camera, which could be loaded instead the full image. Not sure about that...

          > It doesn't seems to work with "duplicateMovieClip" on dynamic created mc so I need to make a new emptyMC and load > the image into it. That takes about a second.

          Yep, dynamically loaded content cannot be duplicated. Flash should load it the 2nd time from the cache though, so it should be faster than the first loading.

          > Is it possible to create a movieClip to the library in runtime and then use attachMovie() for every new instance that i
          > want to create?

          No, afaik you can't add items to the library at runtime. You could add an MC in the Flash IDE and use this with attachMovie(), but I doubt that this will be faster than createEmptyMovieClip(). Could be worth a try though.

          hth,
          blemmo
          1 person found this helpful
          • 2. Re: Load images in runtime
            Thanks for your answer blemmo..
            unfortunately I have to use the large imagefiles. I have made them smaller in photoshop, and it helped a lot, but what i really want to do is to change the filesize in flash, but I guess that isn't possible.

            I didn't really understand what you ment by adding an MC in the Flash IDE, that is something I don't know about. But when the filesize is small, the "createEmptyMovieClip()" was fast enough.

            /Antewik