9 Replies Latest reply on Oct 28, 2008 12:08 PM by Newsgroup_User

    Two "go to" questions

    adiabatic
      The following Director 7 button statement works in going from a movie in the "Water&Sun-1_DVD" folder to a movie in the "WI-1" folder

      go to movie "Macintosh HD:DVD Projects:Water&Sun-1_DVD:Chapter_1:WI-1:W1_1sim"

      Question#1: Since this is specific to a Mac (it doesn't work if Macintosh HD is omitted) does this mean that a script will not be cross platform if it involves a "go to" statement? It would be great if I didn't haved to go back to the HD to make the transition.

      The following Director MX statements do not work.

      _player.searchPathList=["Macintosh HD:DVD Projects:Water&Sun-1_DVD:Chapter_1:WI-1:W1_1sim:"]
      go to movie "W1_1sim"

      They produce the error message: Where is "Wi_1sim" ? when the button is clicked.

      Question#2: What's wrong AND can an MX "go to" statement be configured that will go between folders rather than going back to the HD?

      Fred Tabbutt
        • 1. Re: Two "go to" questions
          Level 7
          You most certainly shouldn't hard code paths into you movies. Check the
          docs for _movie.path and '@' and see if the entries make sense to you.

          For example, if you're going to rely on setting the searchPathList you
          should base it on the moviePath or the applicationPath:
          -- ...
          mPath = _movie.path
          -- assuming your current movie is in a folder that has the
          -- following named sub-folders
          _player.searchPathList.append(mPath & "Water&Sun-1_DVD")
          _player.searchPathList.append(mPath & "WI-1")
          -- ...
          • 2. Re: Two "go to" questions
            adiabatic Level 1
            Sean,
            Your response helped clarify file linkages. I am especially attracted to the @ operator since it is cross platform and so succinct. But I still have some questions.
            FIRST ... are the following conclusions correct?
            1. If littleFolder is a subfolder of MediumFolder and MediumFolder is a subfolder of bigFolder and the program is currently in a movie in bigFolder and I want to link to the movie linkedFile in littleFolder then
            @:bigFolder:mediumFolder:littleFolder:linkedFile
            will do it.
            2. However, for the same sequence of folders, if the program is in a movie in LittleFolder and linkedFile is in bigFolder then
            @:::linkedFile
            will do it.
            In other words, to go down in subfolders you need to know the folder names but to go up, you don’t.
            SECOND ... Once you establish this @ link how do you use it? How do you move from your current movie to the movie described by the @ statement?

            I do appreciate your patience. One could argue that a 76 year old retired chemistry faculty should know better than to be doing this but it is part of supplemental interactive exercises from a chemistry text I am trying to finish before I completely lose brain function.

            Fred Tabbutt
            • 3. Re: Two "go to" questions
              Level 7
              Hi Fred,

              > FIRST ... are the following conclusions correct?
              > 1. If littleFolder is a subfolder of MediumFolder and MediumFolder is a
              > subfolder of bigFolder and the program is currently in a movie in bigFolder and
              > I want to link to the movie linkedFile in littleFolder then
              > @:bigFolder:mediumFolder:littleFolder:linkedFile
              > will do it.

              I would think that "@/mediumFolder/littleFolder/linkedFile" would be
              correct, given that the "@/" character combination effectively means
              "the folder the current movie is in"
              BTW: I tend to use the forward slash as there is no confusion about its
              platform-independence.

              > 2. However, for the same sequence of folders, if the program is in a movie in
              > LittleFolder and linkedFile is in bigFolder then
              > @:::linkedFile
              > will do it.

              Same thing, start with your current folder "@/" and navigate up as many
              folders as required, so that would be: "@///linkedFile"

              > In other words, to go down in subfolders you need to know the folder names but
              > to go up, you don?t.

              Exactly.

              > SECOND ... Once you establish this @ link how do you use it? How do you move
              > from your current movie to the movie described by the @ statement?

              You issue a command like:
              _movie.go(1, "@/mediumFolder/littleFolder/linkedFile")

              However, it might be easier to base your navigation off "the
              applicationPath" since this won't change, whereas "the moviePath" (or
              "@" to use its shorthand representation) will if you have a folder
              hierarchy with Director movies scattered through them. In that case you
              might use something like (assuming the executable is in bigFolder):
              appPath = _player.applicationPath
              tFolderDelim = appPath.char[appPath.length]
              tTarget = appPath & "mediumFolder" & tFolderDelim & "littleFolder" &
              tFolderDelim & "linkedFile"
              _movie.go(1, tTarget)
              • 4. Re: Two "go to" questions
                adiabatic Level 1
                Sean,
                If you’re still willing I have some questions about your last response.

                What is the meaning/significance of the “1” in your line of code
                _movie.go(1,”@/mediumFolder/littleFolder/limnkedFile”)

                1. Until your last note I had not appreciated that
                _moviePath is a movie property
                while _player.applicationPath is a property which during run time tracks projectors.

                Currently the only projector I have is a stub projector that initiates the sequence of about 20-30 movies depending on the user’s choice. BUT I intended eventually to convert all to projectors for a DVD medium. If I do that will only _player Application work? And since the original movies will still be there, after projectors for them have been created, should they be removed?
                2. Another reason to follow your suggestion about using _player.Application is that on page 780 of Properties it says that a Mac will substitute a : for a / which will cause an error if run on a DVD.
                3. So I need to better understand the 4 lines of application code you sent to me. I will give the line of code and then my interpretation of what I think it is doing.

                appPath=_player_.applicationPath
                This sets appPath=the current location

                tFolderDeliver=appPath.char[appPath.length]
                This sets tFolderDeliver equal to the number of items (movies?) in the current folder using the length property.

                tTarget=appPath & “mediumFolder”& tFolderDelim & “littleFolder”& tFolderDelim & “linkedFile”
                tTarget is the pathway from the current folder to LinkedFile in LittleFolder.
                Two questions about this line.
                1. Why does tFolderDelim have to appear twice? What would have happened with just one tFolderDelim?
                2. Why the "t" preceding Target and FolderDelim?

                _movieup(1,tTarget)
                This moves from movie/projector in the initial folder (BigFolder) to linkedFile two folders down in LittleFolder.

                Now to see if I get this, I hope the following moves from a movie/projector in littleFolder to linkedFile, a movie/projector 2 files up in topFolder.

                appPath=_player.applicationPath
                tFolderDelim=appPath.char[appPathlength]
                tTarget=appPath& “mediumFolder” & tFolderDelim + “topFolder” + tFolderDelim & “linkedFile”
                _movie.go(1,tTarget)

                I am really struggling with the new code format of MX compared to previous Director formats. But thanks to you it is becoming understandable.

                I appreciate your patience.

                Fred Tabbutt

                • 5. Re: Two "go to" questions
                  Level 7
                  > What is the meaning/significance of the ?1? in your line of code
                  > _movie.go(1,?@/mediumFolder/littleFolder/limnkedFile?)

                  If you read the docs for 'go()' it will tell you that it's the frame
                  number of the Director movie you are navigating to

                  > I am really struggling with the new code format of MX compared to previous
                  > Director formats. But thanks to you it is becoming understandable.

                  Before we get too deeply into other options, which version are you
                  using: MX, MX2004, or 11?
                  • 6. Re: Two "go to" questions
                    adiabatic Level 1
                    Sorry. I should have caught that go() method.

                    I am using MX 2004
                    • 7. Re: Two "go to" questions
                      Level 7
                      > What is the meaning/significance of the ?1? in your line of code
                      > _movie.go(1,?@/mediumFolder/littleFolder/limnkedFile?)

                      So I assume you're now comfortable with the 1 in the above expression

                      > _moviePath is a movie property
                      > while _player.applicationPath is a property which during run time tracks
                      > projectors.

                      Be careful - the above should be _movie.path (or 'the moviePath) (note
                      the full stop between the object and its property). They are both valid
                      author-time and run-time properties.

                      > Currently the only projector I have is a stub projector that initiates the
                      > sequence of about 20-30 movies depending on the user?s choice. BUT I intended
                      > eventually to convert all to projectors for a DVD medium. If I do that will
                      > only _player Application work?

                      No, you can use _movie.path, but it might be more complicated in that
                      you'll need to remember which movie is where relative to the current
                      one. If you use 'the applicationPath' (or _player.applicationPath) then
                      all your movie files should be "under" (or beside) the application.

                      > And since the original movies will still be
                      > there, after projectors for them have been created, should they be removed?

                      You should only need to create a single projector, and optionally
                      protect the individual movie files you will navigate around amongst.

                      > appPath=_player_.applicationPath
                      > This sets appPath=the current location

                      No, it sets the local variable 'appPath' to be the full path to the
                      folder containing the application that launched the current movie file.

                      > tFolderDeliver=appPath.char[appPath.length]
                      > This sets tFolderDeliver equal to the number of items (movies?) in the current
                      > folder using the length property.

                      That was 'tFolderDelimiter', and in sets this local variable to the
                      correct folder delimiter for whichever platform the application is
                      running on: "\" for Windows and ":" for Macintosh

                      > tTarget=appPath & ?mediumFolder?& tFolderDelim &
                      > ?littleFolder?& tFolderDelim & ?linkedFile?
                      > tTarget is the pathway from the current folder to LinkedFile in LittleFolder.
                      > Two questions about this line.
                      > 1. Why does tFolderDelim have to appear twice? What would have happened with
                      > just one tFolderDelim?
                      > 2. Why the "t" preceding Target and FolderDelim?

                      tTarget is the full path from the *application* to the target Director file.
                      The folder delimiter needs to appear twice as there are 2 named folders
                      in the hierarchy which need to have the correct platform-dependent
                      delimiter appended.
                      The "t" is simply my reminder-notation that the variable is temporary,
                      as opposed to "g" which usually denotes 'global' or "p" which implies a
                      property of a script object/instance

                      > _movieup(1,tTarget)
                      > This moves from movie/projector in the initial folder (BigFolder) to
                      > linkedFile two folders down in LittleFolder.

                      I'm not sure where you got "_movieup()" from, but I suspect you meant
                      "_movie.go()" which you'll find in the docs

                      > Now to see if I get this, I hope the following moves from a movie/projector in
                      > littleFolder to linkedFile, a movie/projector 2 files up in topFolder.
                      >
                      > appPath=_player.applicationPath
                      > tFolderDelim=appPath.char[appPathlength]
                      > tTarget=appPath& ?mediumFolder? & tFolderDelim + ?topFolder? + tFolderDelim &
                      > ?linkedFile?
                      > _movie.go(1,tTarget)

                      NO, that would take you from a movie *anywhere* that was launched by the
                      application to another movie file named "linkedFile" in the folder
                      "topFolder" which itself is in the folder "mediumFolder" which is itself
                      in the same folder as the application:
                      %applicationFolder%/mediumFolder/topFolder/linkedFile
                      • 8. Re: Two "go to" questions
                        adiabatic Level 1
                        I decided that I felt most comfortable with the _movie.go approach and decided to make a test by converting all of my transition statements to that format and then make a projector and try it out cross platform. However, I got stopped at my first conversion. The original button-activated transition was coded

                        on mouseUp
                        go to movie “IWK-1/anal/intro”
                        end

                        (which is in the same folder) and it worked.

                        Using the new method, I substituted
                        on mouseUp
                        _movie.go(1, “@\IWK-1/anal/intro”)
                        end

                        and got the error message

                        Where is “@:IWK-1:anal:intro” ?

                        So then I tried

                        on mouseUp
                        _movie.go(1, “@\”& “IWK-1/anal/intro”)
                        end

                        hoping that the quotation marks would preserve the / but I got the identical error message.

                        The problem seems to be the use of / in my movie titles.
                        MX is converting every / or \ into a : in the “ _movie” format while allowing them in the “go to” format.

                        So, for the few movie names that have / I should use the older method or is there a way around this in the _movie format?

                        • 9. Re: Two "go to" questions
                          Level 7
                          > on mouseUp
                          > go to movie ?IWK-1/anal/intro?
                          > end
                          >
                          > (which is in the same folder) and it worked.
                          >
                          > Using the new method, I substituted
                          > on mouseUp
                          > _movie.go(1, ?@\IWK-1/anal/intro?)
                          > end
                          >
                          > and got the error message
                          >
                          > Where is ?@:IWK-1:anal:intro? ?

                          For some reason, what should have been plain double-quotes is showing up
                          as a question mark in my news reader.
                          Anyway, that should be:
                          on mouseUp
                          _movie.go(1, "@/IWK-1/anal/intro")
                          end

                          (you shouldn't mix your folder delimiters - start with one and stick to
                          it). The above assumes there is a file named "intro" inside a folder
                          named "anal" which is inside a folder named "IWK-1" which is inside the
                          same folder as the *current* movie playing in the projector (having
                          taken any previous navigation into account).
                          Perhaps you should read the following articles. The code is old-style
                          syntax, but the concepts remain valid:
                          <www.director-online.com/buildArticle.php?id=827>
                          <www.director-online.com/buildArticle.php?id=831>