5 Replies Latest reply on Jan 8, 2013 6:26 PM by Rod@FOF

    Is it possible to have a quicktime pause when the frame changes then resume when the frame stops?

    kevinfillie123

      Is it possible to have a quicktime pause when the frame changes and then resume playing when the frame stops. I am trying to optimize performance and I believe my quicktimes playing when the frame changes is slowing everything down. Any help would be appreciated

        • 1. Re: Is it possible to have a quicktime pause when the frame changes then resume when the frame stops?
          Sean_Wilson Adobe Community Professional

          I'm not sure what you mean by "frame changes" and "frame stops". Can you describe this scenario differently? What makes you think "frame changes" are impacting performance, and how does this relate to QuickTime?

          • 2. Re: Is it possible to have a quicktime pause when the frame changes then resume when the frame stops?
            kevinfillie123 Level 1

            What I am building is a interactive "I-Wall" where the user can drag a 42" monitor left and right and that will bring up different videos and graphics. The left and right motion of the monitor changes which frame of the timeline you are at. I have graphics and videos sliding onto and off the stage accordingly. I am wondering if the video can pause itself when there is a frame change [monitor being dragged], and then wait a half second to begin playing after a rest [monitor not being dragged]. I feel like not having video playing when the monitor is being dragged will produce a smoother more optimized effect. Right now it is a little sluggish.

             

            I am thinking using a placeholder graphic on frame changes and then using a timer object. Not sure how to do it with lingo though. I hope this better describes the situation and any help would be appreciated. Thanks

            • 3. Re: Is it possible to have a quicktime pause when the frame changes then resume when the frame stops?
              Sean_Wilson Adobe Community Professional

              To pause a QuickTime video you use sprite().movieRate = 0

              • 4. Re: Is it possible to have a quicktime pause when the frame changes then resume when the frame stops?
                kevinfillie123 Level 1

                Yes, I am using that code in other sections where it applies but for this example I need the video to pause when the frame changes and then wait a second to play again when the frame stops changing. So, I need a timer to check if frame has not changed for 1 second and if true then movieRate=1.

                • 5. Re: Is it possible to have a quicktime pause when the frame changes then resume when the frame stops?
                  Rod@FOF Level 1

                  Seems your question might have had more to do with setting up a Timer than a method for stopping the QuickTime.

                   

                  So, why not put the QuickTime pause Sean proposes on the "mousedown" you use during dragging? Then on the "mouseup" or "mouseleave" on that same sprite you could cause a timer to start. Here is one simple way to cause that to happen.

                   

                  Behavior 1 attached to your drag sprite-----------

                  global gQuickTimer

                  on MouseLeave me

                       gQuickTimer = the ticks

                  end  --------------------------Behavior 1--------------

                   

                  By setting the ticks to a value based on the "mouseleave," it gives you a base from which to begin counting time when you exit the "drag" process. Of course, this start could occur from any other point you choose, with commands other than the "mouseleave," as fits your needs. But this clearly illustrates the concept.

                   

                  At this point, all you have to do is compare gQuickTimer, a global which is based on the ticks at the point it was executed, with the current ticks (where we are now). So, an ExitFrame handler, attached to either Behavior 1 or a frame Behavior can be used to do a simple count. That is done by, for example: Ctime = float((the ticks - gQuickTimer)/60.0) This takes the ticks counts and turns it into seconds.

                   

                  Here is what it looks like as a behavior, or as a component of behavior. Put it where it makes sense, so long as it is in an ExitFrame behavior.

                   

                  Behavior 2 attached to your drag sprite, added as an element in your drag sprite, or in a frame sprite-----------

                  global gQuickTimer

                  on exitFrame me

                  CTime = float((the ticks - gQuickTimer)/60.0)

                    if Ctime => 1.0 then -- or any seconds value you want, can be hard code like this or added

                                                    --in a property list, yet another story

                     QuickTime video you use sprite().movieRate = 1

                    end if

                  end ----------------------------------------------------------------------------------------- ----------------------------------------

                   

                   

                  What is happening here is tht gQuicktimer gets set and then compared with the current time. Then, on an exit frame handler, when it reaches a point you have determined, it causes an event to resume. In your case, that is the restart of your QuickTime movie, but it can be anything.

                   

                  This is really a very crude rendering of a timer. You probably should just do a search on "Director timers". You will see many very sophisticated options that put this simple concept to shame.The better options ar worth learning about, if you are serious.

                   

                  Hope this helps.

                   

                  Rod