8 Replies Latest reply on Aug 7, 2008 2:39 PM by Newsgroup_User

    playing portions of a QT movie with Director

    adiabatic Level 1
      By using loopBounds I thought I could have a user click on a button which would begin looping an interval in a QT movie which had been cited in a loopBounds statement. Is that correct?

      If so, why doesn't the following statement placed at the beginning of the sprite containing the QT movie entitled "Water 1994" produce the error message "Script error: Name expected"?

      on beginSprite me
      sprite(me."water 1994").loopBounds[(3.00*60*60.4.50*60*60)]
      end

      I had hoped that it would play the 3.00 - 4.50 minute interval in the QT movie "water 1994" repeatedly until the user clicked a button to go somewhere else.
      (Part of this is probably my difficulty in going from the the verbose Director 2004 scripting to Director MX dot syntax format. Do I have to use an integral number of minutes?)

      Fred Tabbutt, retired faculty
        • 1. Re: playing portions of a QT movie with Director
          robdillon Most Valuable Participant
          You want to reference the sprite number, not the name of the member of the sprite. So, you probably want to say:
          sprite(me.spriteNum).loopBounds[(3.00*60*60.4.50*60*60)]
          Also, be sure that the QT member is set to loop.
          • 2. Re: playing portions of a QT movie with Director
            adiabatic Level 1
            Rob, I still get an error message

            Script error: Variable used before assigned a value
            Sprite(me.2?).loopBounds=[(60*60).(120*60)]

            The QT movie is located in sprite 2 starting in frame 1. The behavior script shown below is for frame 1. The QT movie has the video, audio, loop and DTS boxes checked. (The time limits are changed since the previous ones exceeded the duration of the QT movie.)

            I really appreciate your help in trying to solve this frustrating roadblock.

            Fred Tabbutt


            • 3. Re: playing portions of a QT movie with Director
              Level 7
              You could attach the following, as a behavior, to the QT sprite:
              --
              on beginSprite me
              sprite(me.spriteNum).loopBounds[3.0*60*60, 4.5*60*60]
              end

              Or the following to any other sprite that initialises *after* sprite 2
              --
              on beginSprite me
              sprite(2).loopBounds[3.0*60*60, 4.5*60*60]
              end
              • 4. Re: playing portions of a QT movie with Director
                adiabatic Level 1
                Problem persists.

                I thought I had solved the problem when I realized that I had attached the behavior to the frame where the sprite begins and not to the sprite. So I attached the following behavior to the QT movie sprite that was in the second row of the score:

                on beginSprite
                sprite(me.2).loopBounds=[(120*60).(180*60)]
                end

                Now I get the error message

                script error: Name expected
                sprite(me.2).loopBounds=[(120*60).(?180*60)]

                substituting the name of the sprite in quotation marks for 2 produces the same error message.

                Is this a mission impossible?

                frustrated,
                Fred Tabbutt

                • 5. Re: playing portions of a QT movie with Director
                  Level 7
                  Why do you persist in trying to shoehorn "me.2" into your sprite
                  reference? It's incorrect and shouldn't even compile, but will always
                  throw a runtime error.
                  Like I suggested in my last post (where I neglected the assignment
                  operator):
                  You could attach the following, as a behavior, to the QT sprite:
                  --
                  on beginSprite me
                  sprite(me.spriteNum).loopBounds = [3.0*60*60, 4.5*60*60]
                  end
                  • 6. Re: playing portions of a QT movie with Director
                    robdillon Most Valuable Participant
                    When you place a behavior on a sprite, the reference to the sprite is "me". In that behavior if you want to find the actual sprite number, you can ask for the value of the built in property spriteNum, as in "me.spriteNum". To aid in the speed of playback and to make the code more readable, it is ordinary to define the value of me.spriteNum in the behavior like this:

                    property thisSprite
                    on beginSprite me
                    thisSprite = me.spriteNum
                    end

                    or

                    property thisSprite
                    on beginSprite me
                    thisSprite = sprite(me.spriteNum)
                    end

                    then you can refer to the current sprite through that property variable.

                    In the last few versions of Director you have been able to name sprites. I personally find this just plain silly and potentially very confusing for new users as many new users have difficulty differentiating between cast members and sprites.
                    In a behavior, when you want to reference a sprite, you usually do it by referencing its channel number as in sprite(2). If you don't want to use the actual number, then you can use sprite(me.spriteNum) to have Lingo get the number for you. If you've used one of the beginSprite functions that I listed above, then you can use sprite(thisSprite), from the first example, or, simply thisSprite from the second example.

                    Having said all of that, if you will just use one of the examples that Sean gave to you, I think that you will find that the code will work as expected.
                    • 7. Re: playing portions of a QT movie with Director
                      adiabatic Level 1
                      First of all, thank you Rob and Sean for your patience and help. Unfortunately, while it was illuminating (for example, I had wondered why the cast member name no longer appeared when it was dragged into the score), I have not been able to get loopBounds to work.

                      If either of you are still interested I could email you the Director movie consisting of only 3 lines of sprite behavior code and a 4 minute QT movie which I have not been able to access by the loopBounds statement.

                      I have had no trouble in the past playing QT movies in Director and changing their speed, so long as I played the whole thing. Trying to play just part of it seems beyond the reach of this retiree. While I have had no trouble teaching FORTRAN, BASIC, MathCad, and using Director 6, 7 etc. , I seem to have met my match with dot me Director.

                      (My email address is tabbuttf@evergreen.edu .)

                      Fred Tabbutt


                      • 8. Re: playing portions of a QT movie with Director
                        Level 7
                        Perhaps I didn't understand your original goal. You might have a look at
                        the MPEG Advance Xtra and its playSegment() method:
                        < http://xtras.tabuleiro.com/products/mpeg_advance/index.tdb>