Trigger on variable change

approg
Community Member Posts: 258 ♪ Opening Act ♪
Comments
-
-
Hello approg:
This is very simple. Stan, actually is correct. It is something that must be triggered. You know where it needs to be placed dependent on the need for it.
If I understand correctly, you want the action to happen as soon as the modification of the variable happens. This will require a check at that very point. Add a second action, after the modification action, to do whatever is required if the variable is satisfied. Be sure to delay this action by at least 2 tenths of a second to allow the computer modification to run.
Hope this helped! -
Thanks for the help but I should've provided more background information.
We've had an "interesting" interaction built for us in HTML5 that I've dropped into Lectora. The interaction changes the value of an Lectora custom variable when it's been completed. A few things in the Lectora title are inactive until the interaction has been completed.
I don't want the developer of the interaction to hardcode anything other than the name of the Lectora variable (so that I can reuse the interaction in other titles). So I'd like my Lectora title to know when the variable has been changed and to then trigger an action. -
-
Following up on Tim's idea of using a button with a className. You could use a transparant button/element, on completion trigger that transparant button to become visible ( from the Html interaction ) and on that button/element you have onShow actions that will trigger whatever you want. This way on completion things can happen without user interaction. If you design the button/element to fit into the overall design it will look seamless.
You even can use a incredible small element ( 1 pixel ) to have no visual impact. -
-
Interesting Tim... wondering however if and how that works.. in Lectora Online ( and probably the same approach now in Lectora 18 ) a textbutton on screen is renamed in the HTML to...
<div id="tobj3462" class="testBttn" >
<button name="3462button">
The latter...button name is only given several divs deeper, since now Lectora uses SVG for creating the graphics for the button. The className testBttn can be given to it as before...
When i check the Trivantis generated code in Lectora Online... i find these codes for the buttons on my page...
var textbutton3025 = new jsWndTextButton(); //ExitClose
var textbutton2386 = new jsWndTextButton(); //Prev
var textbutton3462 = new jsWndTextButton(); //Button 5
var textbutton2388 = new jsWndTextButton(); //Next
var textbutton2393 = new jsWndTextButton(); //TOC
Interesting... -
Instead of using a button I used a small text box that contains just a single space (so that the text box is never visible). The text box is hidden and then I use JavaScript to make it visible and as it shows it triggers an action(s) attached to it.
The text box has a CSS class added to it called "foo" (it doesn't matter that the associated CSS doesn't exist.)
The relevant js in the interaction looks like
var p = parent.window,
t = p.document.querySelector(".foo");
if (t && t.id && p[t.id + "actionShow"]) {
p[t.id + "actionShow"]();
}
Categories
- 35.8K All Categories
- 108 ✫ Announcements
- 33.1K Lectora®
- 31.1K Lectora Discussions
- 28.9K Lectora Desktop
- 2K Lectora Online
- 2K Lectora Feature Requests
- 71 Lectora User Groups
- 36 Lectora Accessibility User Group (LAUG)
- 22 ELB Learning Content
- 22 ELB Learning Content Discussions
- 321 CenarioVR®
- 188 CenarioVR Discussions
- 133 CenarioVR Feature Requests
- 41 Rockstar Learning Platform®
- 38 Rockstar Learning Platform Discussions
- 108 CourseMill®
- 108 CourseMill Discussions
- 47 ReviewLink®
- 47 ReviewLink Discussions
- 5 The Training Arcade®
- 5 The Training Arcade Discussions
- 934 All Things eLearning
- 36 eLearning Development
- 546 Learning Management System (LMS) Integration
- 332 Web Accessibility
- 1.2K ♪ The Green Room
- 9 Additional Learning Products