Feature update – new syntax for *wait, custom events
Here’s what’s new: |
*wait syntax updateWe have updated the way you tell GuidedTrack how long to *wait. This change will not make your running programs break, but if you edit a program that contains this keyword you will get an error message prompting you to use the new syntax. In the example below, the program waits 4 seconds before displaying the button: Basically, now there is a period between the number and the word “seconds” or “minutes”. The changes we have made now allow you to: WAIT A FRACTION OF A SECOND USE VARIABLES TO SPECIFY DELAYS WAIT A COMBINATION OF MINUTES AND SECONDS WAIT FOREVER This is how this program looks, and this is what it looks like without *wait. |
Custom eventsWe introduced the keyword *events with the attribute *startup to have your GuidedTrack program do something every time that a user returns to it. Now we have enhanced its functionality so that you can trigger custom events using JavaScript. This is a super powerful tool that allows you to control the program navigation using events and even send data from JavaScript to GuidedTrack. This feature is only for when embedding your program on a website and you will need to have a working knowledge of HTML and JavaScript. Here is a simple program that uses custom events: The program above has an event called “loadFinalPage”. In order to trigger this event, you would have a script in the page where the program is embedded that would look like this: jQuery(window).trigger(‘loadFinalPage’, {“message”:”going to final page”, “message2″:”because a button was clicked”})Note that the event’s name in the JavaScript code matches the name in your program! When the JavaScript event occurs, the GuidedTrack code under the event runs immediately. See also how the JavaScript code passes an array of data that gets stored in the association it so that you can read this data from within the program. So, if the event loadFinalPage is triggered as shown above, the sample program will display message1 and message2 and then go to the label final_page no matter where the navigation was at that point. Also, know that your program can have different events, you just need to create them as shown above. |