Using Timer to check for variable change which causes page to auto navigate

setarcos
setarcos Community Member Posts: 33
Hello.

I trying to set up functionality where a page would automatically navigate when a variable changes. I have set up a Timer that checks for the variable change and a group to run upon variable change that contains the GoTo action. I cannot seem to get this to work. Any suggestions? Is this possible? Thanks!

Comments

  • timk
    timk Community Member Posts: 1,245 ✭ Legend ✭
    Create a variable, e.g. "letsgo", intial value = "no"



    Add an action on page level:



    On: Timed Interval

    Interval: 0.1

    Action: Go to

    Target: Somewhere



    Condition: Only if letsgo equal to yes



    Somewhere on your page you'll need an action to set the variable to "yes"



    Tim
  • setarcos
    setarcos Community Member Posts: 33
    @timk I have rebuilt following your suggestions and still cannot get this to work. To elaborate:

    I have a Launch page that opens a popup window. When the popup is closed I want the Launch page to automatically navigate.



    I have a variable called auto_nav that is initially set to false.

    On my Launch page I have a timer action to trigger the GoTo behavior on the condition that auto_nav is equal to true.



    My popup window has an OnHide action to modify the auto_nav variable and set it to true. So, when I close the popup the auto_nav variable does change to true but the launch page does not navigate.



    I can't figure out why this is failing. I must be missing something.
  • timk
    timk Community Member Posts: 1,245 ✭ Legend ✭
    I've tested what you describe and it's working properly.



    On the launch page there's one action:



    On: Timed Interval

    Interval: 0.1

    Action: Go to

    Target: Next page



    Condition: Only if auto_nav equal to true



    On the popup page there's one action:



    On: Hide

    Action: Modify variable

    Target: auto_nav

    Type: Set equal to

    Value: true



    When the popup is closed the main window goes to the next page.



    You wrote that your Go to action is in a group. Why? Do you run that action group somewhere?



    Tim
  • setarcos
    setarcos Community Member Posts: 33
    @timk I used an action group in my first tries but have since rebuilt per your suggestion. Thanks so much for your help. I'll keep working at it.
  • setarcos
    setarcos Community Member Posts: 33
    @timk Okay. I got this to work. I had a blank space after "true" in my conditional. Thanks again.
  • setarcos
    setarcos Community Member Posts: 33
    So now I've run into another issue that I hadn't thought of. On the popup page I'm using a Table of Contents component to navigate to various topic pages (all in popups). I'm wondering if there is a way to set the auto_nav variable to true only if the learner closes the TOC popup using the "x" (firing the OnHide action) and not when the learner uses the TOC to navigate around the various topics which return to the TOC popup when each is finished.



    I hope that makes sense :confused: Thanks for any help.