10 Replies Latest reply on May 29, 2007 12:20 PM by Newsgroup_User

    Memory Management

    Yue_Hong Level 1
      The director project I am building now is having full screen background animation which is build up by frames of images. So, in order to reduce the use of memory, I have tried to unload the images from memory as soon as after playback.

      Here is my code:
      _movie.unLoad(_movie.frame-1)

      The animation is playing smoothly with the memory usage around 20MB for all the time when it is loaded from harddisk. However, it plays with a bit lagging when it is load from CD ROM. So, I added the preload code.

      _movie.preload(_movie.frame+1,_movie.frame+3)

      But this doesn't seems help at all. The animation is playing lagging as well even it is load from hard disk.

      So, here I want to ask:
      1. How to code it to unload only the sprite(1) member?
      2. What is the way (in coding) to have it play smoothly from CD ROM?
      3. Will the content be load more faster and play more smoothly on DVD?
        • 1. Re: Memory Management
          Level 7
          How large are the images (dimensions)? Bit depth? Are they fully
          imported or linked?
          • 2. Re: Memory Management
            Yue_Hong Level 1
            The image resolution is 800 x 600, as big as the projector size. When imported, I have chosen stage (24 bit) and they are imports as linked.
            • 3. Re: Memory Management
              Level 7
              > they are imports as linked.

              So does it make a difference if you fully import them?
              • 4. Re: Memory Management
                Yue_Hong Level 1
                If I import them fully, then I'll have a huge projector file (exe) with around 600 to 700MB. This will caused it take long time to start the projector. Also, from my understanding, if imported fully, it will load everything into RAM when startup. If this is the case, then the file will directly use up more than 2GB of RAM when it run.
                • 5. Re: Memory Management
                  Level 7
                  > If I import them fully, then I'll have a huge projector file (exe) with around
                  > 600 to 700MB. This will caused it take long time to start the projector.

                  Then you should be creating a stub projector.

                  > Also,
                  > from my understanding, if imported fully, it will load everything into RAM when
                  > startup. If this is the case, then the file will directly use up more than 2GB
                  > of RAM when it run.

                  No, this isn't correct.
                  • 6. Re: Memory Management
                    Yue_Hong Level 1
                    So, is that mean by fully import all images into the projector will guaranty smooth playback on CD ROM? Seems I have imported those images as linked, is there easy way to change it to fully imported without re-import them?
                    • 7. Re: Memory Management
                      Level 7
                      _movie.preload(_movie.frame+1,_movie.frame+3)

                      Wouldn't this constanly re-preload 2 frames?

                      I might suggest just _movie.preload(_movie.frame+5)

                      Another way that might work would be to use an external cast, import all the
                      graphics in it, then do a shockwave publishing of the cast using a jpeg
                      compression that works best, and is the smallest possible. Then use a
                      behavior with a counter to swap through the members of the cast in an
                      exitframe handler.


                      "Yue_Hong" <webforumsuser@macromedia.com> wrote in message
                      news:f39ekn$a7s$1@forums.macromedia.com...
                      > The image resolution is 800 x 600, as big as the projector size. When
                      > imported, I have chosen stage (24 bit) and they are imports as linked.


                      • 8. Re: Memory Management
                        Level 7

                        As I recall:

                        write a repeat loop in lingo setting the filename to an empty string
                        will "import" the images.

                        repeat with i = numberOfFirstMember to numberOfLastMember
                        member(i).fileName = ""
                        end repeat

                        Make a backup first in case my memory doesn't serve...

                        HTH,
                        Manno


                        Yue_Hong wrote:
                        > So, is that mean by fully import all images into the projector will guaranty
                        > smooth playback on CD ROM? Seems I have imported those images as linked, is
                        > there easy way to change it to fully imported without re-import them?
                        >


                        --
                        aloft
                        Hoge der A 20a
                        9712AD Groningen
                        The Netherlands
                        info@aloft.nl
                        http://www.aloft.nl
                        • 9. Re: Memory Management
                          Level 7
                          > So, is that mean by fully import all images into the projector will guaranty
                          > smooth playback on CD ROM?

                          No, I'm not saying that at all. But I /am/ saying it's something you
                          should at least try - if you don't, you'll never know whether it may
                          have solved your issue or not.
                          • 10. Re: Memory Management
                            Level 7
                            I agree with Mike. Try importing them all to an EXTERNAL cast and I suggest
                            shocking it. It should come out much smaller than you are expecting. Also,
                            import them a bit at a time, or write a script that imports them, but use
                            savecastlib every 20 or so members, or it will fill up the memory.

                            As far as gauranting smooth playback off a CD, this mainly depends on the
                            speed of the CD player and how many apps you have open. I have a really old
                            win98 pc in the garage, 333 mhz, and sometimes I can get my CD projects to
                            play ok on them, but on my high-end laptop, if I have several apps open, and
                            an email comes in, it staggers. It seems while CPU's, RAM, and video cards
                            have vastly improved in the last few years, CD-drives are still about the
                            same playback wise as they were 5 years ago.

                            One other thing to try might be get it into a Flash Video. I'm having good
                            results off the CD. And really, why would you have all the separate images
                            and not use QT, FLV or something to be more efficient?

                            Timm

                            "Sean Wilson" <webforumsuser@macromedia.com> wrote in message
                            news:f3cpff$7ar$1@forums.macromedia.com...
                            >> So, is that mean by fully import all images into the projector will
                            >> guaranty smooth playback on CD ROM?
                            >
                            > No, I'm not saying that at all. But I /am/ saying it's something you
                            > should at least try - if you don't, you'll never know whether it may have
                            > solved your issue or not.