7 Replies Latest reply on May 19, 2006 5:40 AM by Newsgroup_User

    member preload woes

    Starvoyager Level 1
      First, a quick rundown of how I have the movie set up...

      the first couple hundred frames of the movie are strictly for handling the custom progress bar I designed... I won't even go into trying to get that to work yet, since just the preloading and preload checks all seem to not be working

      first of all, the movie playback options are set to play while downloading (0 frames set to preload here, because I wanted to control it with lingo instead)

      the first cast member is a global script with the following:

      -----------
      on prepareMovie
      _movie.preLoad(1, 151)
      end
      ----------------

      this should load all cast members needed for frames 0 through 151, but doesn't seem to be working

      frame 3 has a frame script that instructs the movie to preload the remaining needed cast members (all the ones that aren't used in the first 151 frames)

      ----------
      on exitFrame me
      preLoadMember(36, 249)
      end
      ----------

      can't be certain if this is working properly or not, because my next framescript also isn't working...

      -------
      on exitFrame me
      if member(249).loaded = true then
      go to frame 152
      else go to frame 4
      end
      -------

      the only way I can even try to gauge what is happening, is by staring at my modem light, and when the net activity stops, the movie still doesn't advance to frame 152.

      The documentation I've found on preload methods has been awful

      (in fact, I've found 2 completely different variations of the preload method alone - [ preLoadMember(x, y) ] and [ member(x).preLoad(y) ] both claim to tell shockwave to preload cast members x through y)

      I'm dead tired of doing trial-and-error by re-uploading the published movie every 3 minutes to test it, since there's obviously no way to test preloading on a local drive. Can someone please tell me what I'm doing wrong?

      final note, this is in Director MX 2004
        • 1. Re: member preload woes
          Level 7
          From the DirMX04 docs:

          --
          Movie method; preloads cast members and stops when memory is full or
          when all of the specified cast members have been preloaded.

          This method returns the cast member number of the last cast member
          successfully loaded. To obtain this value, use the result() method.
          ---

          My guess here is that you are trying to preload so much that the memory
          is full. Try looking at the result. It will tell you if that is the case.

          Why are you trying to preload 213 members at once? Most of the normal
          sprites won't need to be preloaded. Usually you only want to preload
          the larger files, like digital video or Flash content.
          • 2. Re: member preload woes
            Level 7
            The preload commands are more CD-ROM oriented, intended to help manage
            projects too large to completely fit in ram.

            It's a preload from disk command, not a prestream from server command.

            Preload transfers member from the local file into ram, if you issue a
            preload command in te first frame of a movie set to play while
            downloading, one would expect the preload to fail, since the file has
            not yet been downloaded to the local drive. You can't alter the stream
            order of a movie.



            If you want to create an animated preloader it might be best to use a
            separate small preloader movie which issues the preloadNetThing to begin
            the downloading of the main movie one can set a progress bar from the
            bytes loaded status available. After the main movie is fully downloaded
            you can then use Go to net movie to access the main file with no delay
            with no download delays.
            • 3. member preload woes
              Starvoyager Level 1
              quote:

              Originally posted by: Newsgroup User
              From the DirMX04 docs:
              --
              Movie method; preloads cast members and stops when memory is full or
              when all of the specified cast members have been preloaded.

              This method returns the cast member number of the last cast member
              successfully loaded. To obtain this value, use the result() method.
              ---

              My guess here is that you are trying to preload so much that the memory
              is full. Try looking at the result. It will tell you if that is the case.

              Why are you trying to preload 213 members at once? Most of the normal
              sprites won't need to be preloaded. Usually you only want to preload
              the larger files, like digital video or Flash content.



              From what I knew of how it worked, preload was for streaming data from server to client, not loading cast members from disk to memory. The intent is to have only the cast members needed for the progress bar screen download first, start the movie, and then download the remaining cast while the progress bar ticks down.

              The project itself is a game with a lot of animation sequences for explosions and such, hence the need for a lot of cast members.
              • 4. member preload woes
                Starvoyager Level 1
                quote:

                Originally posted by: Newsgroup User
                The preload commands are more CD-ROM oriented, intended to help manage
                projects too large to completely fit in ram.

                It's a preload from disk command, not a prestream from server command.

                Preload transfers member from the local file into ram, if you issue a
                preload command in te first frame of a movie set to play while
                downloading, one would expect the preload to fail, since the file has
                not yet been downloaded to the local drive. You can't alter the stream
                order of a movie.

                If you want to create an animated preloader it might be best to use a
                separate small preloader movie which issues the preloadNetThing to begin
                the downloading of the main movie one can set a progress bar from the
                bytes loaded status available. After the main movie is fully downloaded
                you can then use Go to net movie to access the main file with no delay
                with no download delays.



                ARE there commands for prestreaming?

                I might try the movie to load a movie - it's just bugging me now that I can't get this to work like it used to. At the least, it WAS possible to control the download of cast members and provide a progress bar for it. Perhaps the lingo commands for it have depreciated now, but I know there was a way to do this, because I made it work in D8 (unfortunately I don't have the director file anymore, otherwise I'd just use that for reference.

                Macromedia had a tutorial for it that worked flawlessly , but I can't find it anymore, so I have to assume that Adobe tossed it.
                • 5. Re: member preload woes
                  Level 7
                  Check the docs for 'mediaReady'
                  • 6. member preload woes
                    Starvoyager Level 1
                    quote:

                    Originally posted by: Newsgroup User
                    Check the docs for 'mediaReady'



                    That one worked. sweet. Thanks!

                    And if anyone wants to know, here's how it worked...

                    variable totalLoaded is initialized at value:1
                    -------
                    on exitFrame me
                    if the mediaReady of member totalLoaded = true then
                    set totalLoaded = totalLoaded + 1
                    end if
                    end
                    -------

                    the totalLoaded variable's value will stop at the cast member # that hasn't been loaded yet. it will then slowly count upward as the cast members are downloaded.

                    to create a progress bar or percentage loaded just divide 'totalLoaded' by the total number of cast members

                    only other thing you need to do is make sure EVERY cast member contains something or the counter will stop prematurely.. I like to organize my cast, so I end up with a lot of blank members, so I was forced to fill the blank spaces with 1-bit bitmaps.
                    • 7. Re: member preload woes
                      Level 7
                      You need to take a look at the section of the online help titled, "About
                      streaming movies".

                      Preloading is for local media only, as JB explained. While the docs
                      don't say anything about this, the preload function will only work from
                      a projector, not from shockwave.

                      --
                      Rob
                      _______
                      Rob Dillon
                      Adobe Community Expert
                      http://www.ddg-designs.com
                      412-243-9119

                      http://www.macromedia.com/software/trial/