11 Replies Latest reply on Feb 16, 2007 4:54 AM by Simon_Hook_TCG

    Construction method?

    Simon_Hook_TCG
      Hi,

      I was having massive trouble syncing sound with my swf file in Director but have now sorted this thanks to advice from this site, I went back to the Flash file and added sound there so, swf animation and audio are now one thing! And now runs really well, thank you!

      My problem now is with exporting my Director file, I have managed to get the project to run on both paltforms although the files are not always reconized on all computers? What might this be? And when it does run, it might run very slowly or finish before the end of the animation!

      I've followed Dean's "creating a stub projector" tutorial so I have all the extra's in a folder so there not included within the projector itself! Making a lighter file, but I still fear this file could be to big as there is a slugishness to the play back!

      Could this be down to the compression settings? Or another thought I had was in Dean's "Stub" tutorial he mentioned, when discussing the files tab in the publishing setting window, I qoute: "The options at the bottom, Play every movie in list is only important if we include more than one movie in the projector, WHICH IS NOT ADVISABLE IN ANY SITUATION", I'm a bit worried about this comment as I have included about 9 movies/menu/titles all within the same Director project! Am I right in thinking this could be why my project is running slowly? Do I need to saparate out all of this movie into other projects, similar to how the 'Stub' starts up the main director file?

      Again as always your help would be greatly apprecaited!

      Thanks!

      Si
        • 1. Re: Construction method?
          Level 7
          Hi Simon,

          How large is the swf file? Is the swf the first thing that starts your
          presentation? One option to help it synch better when playing through a projector
          is to preload. I'll come back to this.

          What do you mean by 'the files are not always recognized on all computers'? Do you
          get errors? Hard to say what is causing the problem without more detail on what
          actually is happening.

          When you followed my stub prohector tutorial, did you include only the Xtras you
          need in the folder? If you include more than are actually used, they will still
          load up so increase the startup time.

          You say, "I still fear this file could be to big as there is a slugishness to the
          play back!" are you talking about the stub projector? A stub projector as I
          described will get you the smallest possible size so can't see how it's too big.

          One of the important ways of managing memory in any application is to break it up
          into small linked files. It is better to have ten 10 MB files than one 100 MB file.
          If you're only loading 10 MB at a time, it will load faster and play smoother and
          you may not notice when one movie ends and the other starts. Loading a 100 MB file
          will not necessarily load the content you want at the right time so that file will
          more likely cause sluggish playback. When I said "... if we include more than one
          movie in the projector, WHICH IS NOT ADVISABLE IN ANY SITUATION", what I was saying
          there is no point to be making one large file out of a set of small files and then
          lose the advantage of the memory management side of things I've just talked about.

          OK, so back to the beginning, say you want to start up quickly but what to ensure
          synchronization of your SWF which is in the start movie (my assumption). Create a
          stub movie as I described. in the first frame, have an image or some loading
          message. In your second movie - the one the stub links to, click on all your casts
          and in the Property Inspector, in the Cast tab, change the Preload setting to
          Before frame One. This will mean that the stub will not open the second movie until
          everything in the casts is preloaded into RAM, which will help in synching and
          playback. It may mean you'll pause a while in the stub movie (hence the loading
          image/message).

          To help with the other issues you mentioned, I'll need more info as I asked above.

          regards
          Dean

          Director Lecturer / Consultant
          http://www.fbe.unsw.edu.au/learning/director
          http://www.multimediacreative.com.au



          • 2. Re: Construction method?
            Simon_Hook_TCG Level 1
            Hi Dean,

            Thanks for getting back to us so quick, that's really appreciated!
            OK!
            -How large is the swf file?
            swf main animation=996KB

            -Is the swf the first thing that starts your
            presentation?
            Our main swf movie doesn't start the presentation, I have another intro swf and this leads into a title menu and my main movie runs off of this.

            -What do you mean by 'the files are not always recognized on all computers'?
            I've tried this on one PC which worked fine only my main swf movie finished to soon. I've also tried this on Five Mac's, two of which worked. One ran fine, this was the mac I used to construct the project on, and the second ran ok and in full but a little slowly. Now the other three Mac's I tried this on just didn't reconize the files, they failed to show the Director logo and when I tried to run them, I was given a please choose application to run this file menu. They didn't reconize the file type!

            - Did you include only the Xtras you
            need in the folder?
            I included all extras as my main project isn't that large and I thought better to be safe then sorry! I was also a little confused on how to split files up into PC/MAC. I understood about looking for the right extentions for each but didn't understand what to do with the other files that didn't clearly fit into either of these categories. So left them as they where, when I copied them from the program folder and I also included the projector resources, as you suggested!

            -"I still fear this file could be to big"?
            I mean't the actual main Director file, as I have my entire project constructed within one dir file. I didn't mean the Stub project as I now have this stub loading my main file, but am thinking as the main file is large it could be slowing down the play back?

            -"It is better to have ten 10 MB files than one 100 MB file."
            As my project has been made using only swf's and mp3's the main project file is only 2.5MB and so as it's small do you think it should run fine without breaking it up?

            So after reading your reply and writing mine I'm thinking the main problem could lie with the fact there are to many extras included, as by the sound of things my project really isn't that big at all, so breaking if up is not going to make to much difference, would that be correct?

            I've been trying to get information from as many sources as possible and I just spoke to one person on the phone who just said that he wasn't shore why both Flash and Director have been used as he said I could have done this entire project within Flash, is this correct? Is using both programs together rarely done? We choose Director because of it's exporting and cross platform capabilities, we also really liked the possiblities of the logo'ed file that on double clicking would run our applications. And apart from that the adverts on this site all talk about the programs inter linking! Have we missed the point or are we correct in using the programs we have, in the way we have?

            Once again thanks in advance Dean, really apprecaite having your advice on this, you've been a massive help!!!

            Si






            • 3. Re: Construction method?
              Level 7
              Hi Simon,

              Getting late in Australia so hopefully I'm still coherent while replying to your
              email/

              > -How large is the swf file?
              > swf main animation=996KB

              OK, that's relatively small. Still worth preloading if you have sound and
              animation.

              > I've tried this on one PC which worked fine only my main swf movie finished to
              > soon.

              How are you detecting when the swf is finished? Do you have a script or are you
              relying on the score. You should be using a script (behavior).

              > I've also tried this on Five Mac's, two of which worked. One ran fine,
              > this was the mac I used to construct the project on, and the second ran ok and
              > in full but a little slowly.

              Were the slow ones old computers?

              When playing an animation in Director or Flash, you can tell if there's a CPU or
              RAM problem by the way it plays. If the frame rate looks consistently low, then
              it's a CPU issue. The computer can't process the data at the set frame rate. If it
              plays OK to a point, pauses, then restarts and plays OK, then it is a RAM issue as
              the program needs to pause to load more into RAM.

              > Now the other three Mac's I tried this on just
              > didn't reconize the files, they failed to show the Director logo and when I
              > tried to run them, I was given a please choose application to run this file
              > menu. They didn't reconize the file type!

              Did you burn the CD on a Mac or on a PC? If you burn Mac files on a PC, you can
              lose the part of the file that defines file types on Macs. Better to burn your
              files on a Mac.

              > I included all extras as my main project isn't that large and I thought better
              > to be safe then sorry! I was also a little confused on how to split files up
              > into PC/MAC. I understood about looking for the right extentions for each but
              > didn't understand what to do with the other files that didn't clearly fit into
              > either of these categories. So left them as they where, when I copied them from
              > the program folder and I also included the projector resources, as you
              > suggested!

              I generally create two folder under Xtras called Win and Mac and then dump each OS
              Xtras in their folder. Xtras are platform specific. So, you need both the Mac and
              PC versions of the Xtra.

              > -"I still fear this file could be to big"?
              > I mean't the actual main Director file, as I have my entire project
              > constructed within one dir file. I didn't mean the Stub project as I now have
              > this stub loading my main file, but am thinking as the main file is large it
              > could be slowing down the play back?

              From what you said, the main file doesn't seem too large. You can try the preload
              technique i mentioned and see if this helps at all.

              > So after reading your reply and writing mine I'm thinking the main problem
              > could lie with the fact there are to many extras included, as by the sound of
              > things my project really isn't that big at all, so breaking if up is not going
              > to make to much difference, would that be correct?

              I don't think the additional Xtras are harming the playback. If your file is
              relatively small, then there isn't a need to break it down further.

              > I've been trying to get information from as many sources as possible and I
              > just spoke to one person on the phone who just said that he wasn't shore why
              > both Flash and Director have been used as he said I could have done this entire
              > project within Flash, is this correct?

              Not knowing what you've created, i can't say if it could have been done with Flash
              alone.

              > Is using both programs together rarely done?

              Nooooooooooooooo. As in, VERY often developers will use both Flash and Director
              together.

              > We choose Director because of it's exporting and cross platform
              > capabilities, we also really liked the possiblities of the logo'ed file that on
              > double clicking would run our applications. And apart from that the adverts on
              > this site all talk about the programs inter linking! Have we missed the point
              > or are we correct in using the programs we have, in the way we have?

              Sounds like you've made the right decisions. As you get more experience, you may do
              things differently.

              regards
              Dean

              Director Lecturer / Consultant
              http://www.fbe.unsw.edu.au/learning/director
              http://www.multimediacreative.com.au


              • 4. Re: Construction method?
                Simon_Hook_TCG Level 1
                Hi Dean,

                No worries on being coherent, still as coherent as ever, thank you Dean.

                Right there were some really interesting things you mentioned last time and I’m feeling positive that we’re getting close!

                >How are you detecting when the swf is finished?
                Well when I first brought my movies (swf) files across into Director, I dragged them onto the timeline and stretched them out until I was able to view the whole movie when playing that section of project back. Then when I had each movie at a size I felt happy with or what I thought was playing the whole file I added some script, which I think is a behavior; (go to “titles”) So when this point in the movie is reached, the project jumps back to our title menu, then the viewer can continue to navigate on through the rest of the CD-ROM!

                Is there some other script I should have placed into the script channel, one that says; ‘don’t move on until entire movie has finished playing’?


                >Were the slow ones old computers?
                The other computers I tried this on where not particularly slow / old, from what you said I would defiantly say that our issue here is a CPU issue as the computers that didn’t run correctly, ran consistently slowly, it felt a little like the animation wasn’t running quick enough! So this must be down to the frame rates I’ve set this project to? At the moment everything is set to 25 frames a second, is this incorrect? And if this needs to be changed do I then need to follow this through and re-export my swf file from my Flash project at the correct frame rates? What frame rates work best across all computers?


                >Did you burn the CD on a Mac or on a PC?
                I burnt this project on a Mac, the only difference was that we used a USB stick to try and test this files across different platforms/computers! When you mentioned about burning things we then burnt a CD to see if this would help matters / transfer the information safer! As far as we can see this has worked, the computers that hadn’t recognized the files before now do and we can start up our cd-rom, so when transferring the information across the USB stick some information must have been dropped in the process!


                >I generally create two folder under Xtras called Win and Mac and then dump each OS Xtras in their folder. Xtras are platform specific. So, you need both the Mac and PC versions of the Xtra.
                So what do you then do with the other files that don’t have OS pacific extension?

                So I haven’t tried your preloading option yet, I think this is my next task. But I do think that there is possible an issue with our script which lies at the end of our movie, and also our setting of frame rates / CPU. What do you think?

                Once again your help is much appreciated!


                Thanks Dean

                Si
                • 5. Re: Construction method?
                  Level 7


                  Simon Hook TCG wrote:

                  > Is there some other script I should have placed into the script channel, one
                  > that says; ?don?t move on until entire movie has finished playing??

                  Yes, definitely.

                  Before I give you the answer, just remember that for any media type that plays over
                  time (sound, video, flash),
                  you should never stretch it over a large number of frames to try match the score
                  frames with the time of the
                  media type. This will not be accurate. Reason is, Director is frame based. Sound
                  and video are time based.
                  Frame based means that every frame will be played. Time based will mean time will
                  be maintained. So, if you
                  have a video that's 30 frames playing at 30 fps and a Director animation playing at
                  30 fps over 30 frames, each
                  would be 1 second long. If computer can't handle that data in that amount of time,
                  Director will drop to say 15
                  fps, but still plays every frame. So, animation will now be 2 seconds long. If same
                  issue is the case for the video,
                  it will maintain 1 second by dropping frames, so will play on 15 frames (perhaps
                  every second frame) of the 30.
                  Sound won't speed up but will always maintain a fixed time.

                  Hope that's clear. The point is you can't guarantee a frame rate in Director. You
                  can set a maximum frame rate,
                  not a precise frame rate.

                  Here's a script that you can put in the frame to loop in the frame and keep playing
                  the Flash until it's over.
                  on exitFrame
                  if sprite(3).frame < sprite(3).member.frameCount then go to the frame
                  end

                  The above assumes the Flash sprite is 3. That's a basic script. If there are
                  movieclip, it won't work. Will leave
                  that for another explanation email.

                  Just on the definition of scripts and behaviors. Generally, a code 'object' is
                  called a script. A behavior is a script
                  type. You can have a frame behavior or a sprite behavior. Frame behaviors are put
                  in the scripting channel
                  directly into a frame of the score. Sprite behaviors are attached to a sprite. You
                  can have many sprite behaviors
                  attached to a sprite. You can only have one frame behavior in a particular frame of
                  the score. There are
                  behaviors in the Library palette that are a bit more sophisticated than what I
                  wrote before. These typically have
                  variables that allow you to customize the behavior to suit a particular instance it
                  is used. I'll leave that discussion
                  for another time too.

                  > At the moment everything is set to 25
                  > frames a second, is this incorrect? And if this needs to be changed do I then
                  > need to follow this through and re-export my swf file from my Flash project at
                  > the correct frame rates? What frame rates work best across all computers?

                  As mentioned before, if you have a CPU issue slowing down the frame rate,
                  increasing the frame rate won't help
                  anything. I'd say use a frame rate that works best for your animation and most
                  suitable for the slowest computer.. 25 fps doesn't sound too bad.

                  > so when transferring the information across the USB stick some
                  > information must have been dropped in the process!

                  Well, if the file is on a device that allows the file to be read and written to,
                  then you may have problems moving
                  from PC to Mac because the platform specific part of the file may be lost.

                  > >I generally create two folder under Xtras called Win and Mac and then dump
                  > each OS Xtras in their folder. Xtras are platform specific. So, you need both
                  > the Mac and PC versions of the Xtra.
                  > So what do you then do with the other files that don?t have OS pacific
                  > extension?
                  >

                  Which files are you talking about? All Xtras are platform specific. I'd burn the
                  files on a Mac because of the
                  problems of lost info as mentioned before. So, on the Mac, put all the Mac Xtras
                  into a Mac folder. Copy all the
                  PC Xtras from a PC into a Win folder. Then on the Mac, put those into a single
                  folder called Xtras. So, you
                  have Xtras with the 2 platform folders with their specific files.

                  > So I haven?t tried your preloading option yet, I think this is my next task.
                  > But I do think that there is possible an issue with our script which lies at
                  > the end of our movie, and also our setting of frame rates / CPU. What do you
                  > think?

                  Preloading may help.

                  regards
                  Dean

                  Director Lecturer / Consultant
                  http://www.fbe.unsw.edu.au/learning/director
                  http://www.multimediacreative.com.au



                  • 6. Re: Construction method?
                    Simon_Hook_TCG Level 1
                    Hi Dean,

                    Thanks for taking the time to explain that, I think I'm starting to get the picture!
                    So I've now shortened my main movie, I've left the frame rate the same and discovered the project is already preloading all the extras at the begining. So was just a little confused with the scripting part!

                    When I enter your script:
                    on exitFrame me
                    if sprite(35).frame < sprite(35).member.frameCount then go to the frame
                    end

                    I'm using 35 as this is the number that my sprite sits in my casts, is this correct?
                    But now when I play my project just before the playhead hits this script I get the error: Script error: "zero parameters expected, if sprite(35).frame < sprite(35).member.frameCount then go to the frame"

                    Have I miss understand this or is this an error because my main movie also includes movie clips, none of which are interactive, I just used them to help me construct the file! I take it this makes a difference?

                    Also now I've entered this new script here, do I now place the 'go to titles' onto the actual movie sprite, making this a sprite behavior?

                    Once again thank you for your patients!

                    Si
                    • 7. Re: Construction method?
                      Level 7
                      Simon Hook TCG wrote:

                      > if sprite(35).frame < sprite(35).member.frameCount then go to the frame
                      >
                      > I'm using 35 as this is the number that my sprite sits in my casts, is this
                      > correct?

                      Hi Simon,

                      The '35' refers to the sprite channel number in the Score. So it should NOT be the
                      cast member number. Look at where you've placed the swf in the score. That channel
                      number is what should be put in the Lingo statement.

                      > But now when I play my project just before the playhead hits this script I get
                      > the error: Script error: "zero parameters expected, if sprite(35).frame <
                      > sprite(35).member.frameCount then go to the frame"
                      >
                      As mentioned above. Because you're referring to the wrong channel number, Director
                      can't find the right info.

                      > Also now I've entered this new script here, do I now place the 'go to titles'
                      > onto the actual movie sprite, making this a sprite behavior?

                      Could you remind me what the 'go to "titles" thing is? Do you want to click to go
                      there or just jump there when the swf is done?

                      In terms of the preloading, I was referring to preloading content in the movie not
                      the Xtras. Let me know when you have the swf wait until finished sorted out and
                      then we can look at other things.

                      regards
                      Dean

                      Director Lecturer / Consultant
                      http://www.fbe.unsw.edu.au/learning/director
                      http://www.multimediacreative.com.au

                      • 8. Re: Construction method?
                        Simon_Hook_TCG Level 1
                        Hi Dean,

                        I see! That now works perfectly, sorry still using this program like a time based linear one but getting there! So as this lingo script is channel Pacific I take it that I should ideally be adding each new cast member, to a new channel in the score? Where at the moment I have a lot of different files on the same channel, although this is working OK apart from our few issues!

                        My 'go to "titles" script is one that when the movie has finished playing the playhead jumps back to our title menu so viewer can continue to navigate there way around the cd-rom. No click needed!

                        When you spoke about preloading before I assumed you were talking about preloading the Xtras, obviously not! You meant preloading the content in the movie, would this have much effect as there is not much content in my project? Just a number of swf files, some scripts and a couple of mp3 files?

                        Thanks Dean

                        Si

                        • 9. Re: Construction method?
                          Level 7
                          Simon Hook TCG wrote:

                          > So as this lingo script is channel specific
                          > I take it that I should ideally be adding each new cast member, to a new
                          > channel in the score? Where at the moment I have a lot of different files on
                          > the same channel, although this is working OK apart from our few issues!

                          The script I gave looks at the sprite in a specific channel number. It's important
                          to note the difference between a sprite and a cast member. The sprite is just a
                          representation (instance) of the cast member. A sprite has its own properties
                          separate from the cast member it displays.

                          It is a good idea to keep similar media content in the same channel. For example,
                          if you had different video clips playing at different times, you may always have
                          those in sprite channel 15 (just a random number).

                          The code I gave you was hard coded - i.e. it made a reference to a specific
                          channel number. But, if you had the same behavior inserted at different parts of
                          the score (different frames), it would still work with a different swf as long it
                          was in the same channel.

                          Looking at the script again..
                          on exitFrame
                          if sprite(3).frame < sprite(3).member.frameCount then go to the frame
                          end
                          The above will keep playing the frame until the next swf is done and then will go
                          to the next frame. If you wanted to jump to a new marker when it's done, you can
                          add the following script to the subsequent frame
                          on exiFrame
                          go to "titles"
                          end

                          That way, you could always have the one 'wait till swf is over' cast member
                          behavior rather than writing it for each swf. But, if you wanted to include the
                          'wait until done then jump to' code in one behavior you could write:
                          on exitFrame
                          if sprite(3).frame < sprite(3).member.frameCount then
                          go to the frame
                          else
                          go to "titles"
                          end if
                          end

                          > When you spoke about preloading before I assumed you were talking about
                          > preloading the Xtras, obviously not! You meant preloading the content in the
                          > movie, would this have much effect as there is not much content in my project?
                          > Just a number of swf files, some scripts and a couple of mp3 files?

                          If you open the Property Inspector, click on your cast window and click various
                          cast windows, you will see a 'Preload' option in the Property Inspector. Here you
                          can tell the movie to preload all the content in that cast before the movie loads.
                          If you do this, everything will be loaded into RAM (assuming you have enough RAM
                          available). The advantage of this is that it does not load things separately when
                          it gets to it and therefore create a delay between animation and sound content. If
                          content is preloaded, they could be played at the same time and so synchronization
                          may be better.

                          Hope that is clear.

                          regards
                          Dean

                          Director Lecturer / Consultant
                          http://www.fbe.unsw.edu.au/learning/director
                          http://www.multimediacreative.com.au


                          • 10. Re: Construction method?
                            Level 7
                            Hi Simon,

                            If you're around, let me know how your project ended up. You can drop me an email
                            at d.utian@unsw.edu.au.

                            All the best.

                            regards
                            Dean

                            Director Lecturer / Consultant
                            http://www.fbe.unsw.edu.au/learning/director
                            http://www.multimediacreative.com.au



                            • 11. Re: Construction method?
                              Simon_Hook_TCG Level 1
                              Hi Dean,

                              I think we're pretty much there now, I'm just writing
                              a read me file to direct users to the correct file not
                              that this is complicated, but I'm sure some people
                              will get confused without instructions!

                              I've now changed the file extensions to dxr so
                              people can no longer get inside them. We did have
                              a little issue about the frame rates of the swf files,
                              we've now upped the main movie to 30 fps and this
                              plays much better on quick / newer computers.

                              We did notice on experimenting that computers that
                              are slow / old / got loads on them, just tend to run it
                              slower which is a little frustrating but don't suppose
                              you can completely cover everything!

                              There is possibly one more thing you could help us with,
                              that would be the logo on the projector file you double
                              click to get the application running. Do you have a tutorial
                              that runs through this cos we'd quite like to have our
                              own logo on this.

                              You've been a massive help Dean, really appreciate
                              you taking the time out to get back to us all the way through
                              our publishing process. I know this project would not
                              have been completed without your assistance!

                              Thank you!

                              Si