8 Replies Latest reply on Jul 6, 2006 11:32 AM by vooboo13

    How do I Link between .dir files?

    vooboo13
      I'm having problems linking between other .dir files.

      What I am attempting to do is use director to create index pages. These indexes contain subindexes of other pages that get to videos, text, and other information.

      To test if I am able to link between .dir files, right now I have a Main.dir that links to two sub directories: wordppt.dir, and flashpdf.dir.

      The wordppt.dir just has two buttons that links to a word document, and a powerpoint document. If I go into director and run wordppt.dir I can get both documents to open up using the buttons.

      Now, when I go to Main.dir, and link to the file and lay it out on the score using "link to an external file", the ability to open up the documents disappears. They're not buttons anymore, the page is just an image of the .dir file.

      Am I linking incorrectly? Is there a better way to link between .dir files that are going to end up being indexes to other indexes? I'm using Buddy Xtra to link to files if that makes any difference. Please help me, thanks.



      Vu
        • 1. Re: How do I Link between .dir files?
          Applied CD Level 1
          If you want a simple link that leaves one Director movie and starts playing another use this: _movie.go(frameNameOrNum {, movieName}). If you are playing full screen this works fine, if your projector is running in a window you will find that each movie called appears in its authoring default position or centered on the screen, there’s a fix for this if you need it.

          However, if I understand your question correctly you are looking for something more like what would be called an include function in other languages, ie: I think you want the contents of your two (or more) submovies to display within the context of the main movie. To do this properly you are going to have to read up on “Movies in a Window” also known as MIAW’s. There’s a lot to programming MIAW’s, I’d look for easier options before I put a lot of child windows on the screen.
          • 2. Re: How do I Link between .dir files?
            vooboo13 Level 1
            It turns out that I actually need to link between .exe's. But I found that using:

            _player.go( exefilename )

            ...works very well. Although, the new .exe file returns to the center of the screen as default. You mentioned a fix to this? Please let me know how I would be able to fix that. Thanks!

            Vu
            • 3. Re: How do I Link between .dir files?
              Applied CD Level 1
              I would still recommend trying the _movie.go command, linking to exe’s spawns a new projector for every link, that’s hard on the playback computer and it’s also hard on you, every time you change the contents of the linked movies you’ll need to compile new projectors. As for the window location fix:

              The first movie, whichever one becomes the projector, needs the following movie script:

              on prepareMovie
              _movie.centerStage = FALSE
              End

              All movies, including the projector, need to either share the following movie script or have their own copy:

              on stopMovie
              _movie.stage.rect = _movie.stage.rect
              end

              I also like to uncheck the “centered” option in the display template of all of my movies except the first, but that should be unnecessary.
              • 4. How do I Link between .dir files?
                vooboo13 Level 1
                Oh ok.

                So do you recommend still using .exe's, but linking with using the _movie.go() command? Or are you saying don't use .exe's?

                I also noticed that instead of opening up the next .exe's, it opens up a new window every time. I want the links to just open up in the same window.. All while not trying to have one giant .dir file because we want multiple people to be able to edit the different files - that are, in the end, being linked with one another because they are index pages.

                If you use AIM can you IM me at "vooboo13". Thanks,

                Vu
                • 5. How do I Link between .dir files?
                  Applied CD Level 1
                  Sorry, don't use AIM but you can backchannel me if you have further questions at support (at) appliedcd (dot) com. But in brief, no, don’t link to the exe’s, link to the .dir’s but don’t include the file extentsion in the link. For example, let’s assume that all three of your movies are in the same directory, then the button behaviors in main.dir would be:

                  on mouseUp me
                  _movie.go(1,”wordppt”)
                  end

                  for the first button, and for the other…

                  on mouseUp me
                  _movie.go(1,”flashpdf”)
                  end

                  of course, you will need buttons in each of your sub movies pointing back to the main as follows:

                  on mouseUp me
                  _movie.go(1,”main”)
                  end

                  Two things to note:

                  - if your target movie is not in the same directory as the movie you are leaving you will have to provide a path. There are several ways to do this, I like using relative paths from the currently playing movie (_movie.path), you can use the application path but you’ve got to be careful, when authoring the application path is the location of your Director program, buried somewhere deep in the Program Files directory, when playing from a projector the application path points to the projector. The movie path is always the currently playing movie.

                  - We leave off the file extensions so that the code will still work if the movies are protected. Protecting the movies changes the file extensions from .dir to .dxr or .dcr. If you leave the file extensions off Director will link to any file with a matching name, regardless of extension. (however, if you leave the extensions off (and you should), Director can get confused if more than one file exists in the same directory with the same name but different extensions, this is also true if a folder with the same name is in the directory, my best advice is just be sure you don’t do that.)
                  • 6. Re: How do I Link between .dir files?
                    vooboo13 Level 1
                    Oh I see. Now, I want to put all of this content on a CD. What prevents anyone from just using the .dir files and taking everything? Or is this what you mean by the protected files?
                    • 7. Re: How do I Link between .dir files?
                      Applied CD Level 1
                      Yes, protecting your Director movies locks them and prevents them from being opened by other programmers. Be careful with this, protecting a movie is a one way operation, no one will be able to open the file to view the code, including you (protection is not password reversable). To prevent loosing your project it’s always a good idea to use the backup option. Of course, this only applies to the Director content, it will not prevent a person from copying the PDFs, PPTs, and Word Docs off the CD.
                      • 8. Re: How do I Link between .dir files?
                        vooboo13 Level 1
                        quote:

                        Originally posted by: Applied CD
                        I would still recommend trying the _movie.go command, linking to exe’s spawns a new projector for every link, that’s hard on the playback computer and it’s also hard on you, every time you change the contents of the linked movies you’ll need to compile new projectors. As for the window location fix:

                        The first movie, whichever one becomes the projector, needs the following movie script:

                        on prepareMovie
                        _movie.centerStage = FALSE
                        End

                        All movies, including the projector, need to either share the following movie script or have their own copy:

                        on stopMovie
                        _movie.stage.rect = _movie.stage.rect
                        end

                        I also like to uncheck the “centered” option in the display template of all of my movies except the first, but that should be unnecessary.



                        I used the projector code and put it on the first frame and the other codes in the other .dirs, but it doesn't seem to be working. They're still relocating themselves at the center of the screen. Any thoughts?