1 Reply Latest reply on Aug 9, 2007 8:19 AM by Omnipitence

    Caching dynamicaly loaded movies

    RichardCesar
      Hello,

      I have a problem that has been stressing me out a bit over the past few days, and hopefully one of you knows a thing or two about this and can help me out a bit. I have a Flex2 application which is going to be hosted on a webserver. It makes extensive use of images and movies (all AS3), which are DYNAMICALY loaded into the project. Sounds simple enough. But the thing is, some of these movies I will want many many instances of (complex partical effects for instance), and are rather large (have sound effects attached).

      First off I remembered from older flash applications the concept of "movie instances", but alo and behold, it doesent SEEM to work that way. If I use the Loader() object to get a MovieClip, I have to get another loader object to get another instance of the MovieClip, requiring a seperate load().

      If Flash9 caches these, that wouldent be a problem, but for the looks of things it doesent, and with all the resources the end application will load, it would probably be way over the amount of caching I want

      So my programmer instinct kicks in. Build a resource loader implementing the caching myself. So I sat down to write one.... then I hit a brick wall... Cloning the MovieClips , DisplayObjects, etc... seems neh impossiable. Looking on the web I saw a potential solution in ByteArray, but that doesent work with DisplayObjects or movies. And accessing the bitmap data and "drawing" it on another sprite doesent work either because most of these elements are movie clips themselves, and hence more then a simple bitmap.

      Anyone have any ideas or things im missing here?

      Richard P. Cesar
        • 1. Re: Caching dynamicaly loaded movies
          Omnipitence Level 1
          Hi Richard,
          I was just wondering if you found a solution to this problem as i am having the same problem,,, I use a loader to load in my swf then place it in a dictionary object.. The next time i want to use it i try retrieving it from the dictionary which works fine but removes the first instance of the swf ( so i can only ever have 1 instance on screen at a time );
          Any help would be much appreciated
          thanks
          Omni