11 Replies Latest reply on Oct 4, 2016 9:25 PM by philmodjunk

    install on timer with slider?

    ezeitgeist

      I'm trying to use Install On Timer to go between Slides of a Slider. I have 4 tabs, as it were.

       

      The OnObjectEnter trigger seems to apply to the entire Slider. How do I address a specific Slide? I've named the slides Slide1, Slide2, Slide3, Slide4.

       

      Is there a way to make the script only address a specific slide? OR, is there a way I can script and say when Object "Slide2" becomes active slide, start script?

        • 1. Re: install on timer with slider?
          philmodjunk

          You can give each panel of the slide control a different object name. Then Go To object will bring into view the specified panel.

           

          The OnPanelSwitch and OnObjectModify triggers are both tripped when a different slide control panel is slid into view.

           

          GetContainerObjectAttribute can tell you which panel is currently the front panel

           

          Get (TriggerTargetPanel) and Get ( TriggerCurrentPanel) are also useful functions you can use with Slide Control based script triggers.

          • 2. Re: install on timer with slider?
            ezeitgeist

            The OnPanelSwitch and OnObjectModify triggers with the panel would be triggered with EACH Slide change, correct? If I want a trigger to move from Slide 1 to Slide 2 (which I have working as a trigger OnLayoutEnter), I could use OnPanelSwitch or OnObjectModify to trigger Install On Timer for Slide 2 to Slide 3. BUT for Slide 3 to Slide 4, what is the best route? I could do a 2nd Install On Timer, I guess, that is the time needed for Slide 3 PLUS the time needed for Slide 2 that starts the same time as the Install On Timer Slide 2 to Slide 3 starts. Is there a more efficient way using those other recommended triggers or Gets that I am missing?

            • 3. Re: install on timer with slider?
              ezeitgeist

              Though, if I do an OnPanelSwitch or OnObjectModify trigger to go from Slide 2 to Slide 3, when Slide 3 loads, that script will start again. Which would be a problem.

              • 4. Re: install on timer with slider?
                philmodjunk

                I don't think that you need any trigger. Just a script that uses Go to Object to change the panels for you. It's not totally clear exactly how you want to set this up, so I listed the relevant triggers and functions in case you needed them, but it doesn't really appear that you do.

                • 5. Re: install on timer with slider?
                  ezeitgeist

                  Sorry for not laying it out better. I am setting up an exam where I have Global containers housing PDFs in each Slide. I want to utilize Install On Timer to automatically move from Section 1 to Section 2 to Section 3 to Section 4 to then automatically submit the Exam at the end. Each Section has a different length allowed.

                   

                  So OnLayoutEnter trigger 1: Starts Install On Timer to go from Slide 1 to Slide 2.

                   

                  Then I need to start the next Install On Timer that when done counting down will go from Slide 2 to Slide 3.

                   

                  Then another to go from Slide 3 to Slide 4.

                   

                  And a final countdown to Go to another layout to count as "submitting the test answers".

                   

                  So that is four timer countdowns. I have named each Slide panel. I am just having trouble figuring out how to start each one. I only want each one to trigger once as they are all separate lengths of time.

                  • 6. Re: install on timer with slider?
                    philmodjunk

                    Then the scripts performed by your timers can use Go to Object to select the next panel to show in the Slide Control.

                    • 7. Re: install on timer with slider?
                      ezeitgeist

                      I already have the Go to Object solved, it is the trigger for each Install On Timer script that I am having trouble with.

                      • 8. Re: install on timer with slider?
                        philmodjunk

                        You can only have one timer set on a given window at a time.

                         

                        You can set up a "chain" of Install OnTimerScript calls.

                         

                        Say you want to give the user 15 minutes for the first panel, 20 for the second and 5 for the third...

                         

                        WIth your OnLayoutEnter trigger, perform this script:

                         

                        Install OnTimerScript [ "GoTo2ndPanel" ; Interval: 960 ]

                         

                        For GoTO2ndPanel use this step:

                         

                        Go TO Object ["Object Name of 2nd Panel here" ]

                        Install OnTimerScript [GoTo3rdPanel" ; Interval: 1800 ]

                         

                        and so forth...

                         

                        To cancel the timer, use

                        Install OnTimerScrit []  ---> don't specify any parameters

                        • 9. Re: install on timer with slider?
                          ezeitgeist

                          Yeah, I think you are right, that is the way to go.

                          • 10. Re: install on timer with slider?
                            ezeitgeist

                            One question: What is cancelling a timer do? Does it restart after it completes and need stopping?

                            • 11. Re: install on timer with slider?
                              philmodjunk

                              If you use Install OnTimerScript with an interval of say 10 seconds, then the specified script will be performed every 10 seconds until you use that script to halt the timer.

                               

                              In the "chain" of scripts that I outlined, each use of Install OnTimerScript cancels the timer set up previously. That's why I mentioned that any given FileMaker window can only have one such "timer" set up, but I should have explained a bit more about what that meant.