Flash/Lectora variable exchange
July 1, 2008 12:00 AM
Use External interface from flash. If you want to set a lectora variable from flash:1. Create a lectora variable - lets name it my_var2. Make sure it's included on the lectora page where you want to set it (I usually do this by creating an onShow action on the page --> Modify Variable --> my_var --> Set Variable Contents --> VAR(my_var) and that will set it to itself so it's on the page. 3. From flash include External Interface and call:ExternalInterface.call("Varmy_var.set('value')");or if you want to set it equal to a flash variable called flashVariable:ExternalInterface.call("Varmy_var.set(" + flashVariable + ")");If you want to set a flash variable equal to a lectora variable:1. Make sure the Lectora variable is included on the same page as your flash movie.2. Make sure you include External Interface in flash3. Use this code (assuming the lectora variable is named "mark"):var getLectoraVar;getLectoraVar = ExternalInterface.call("Varmark.getValue");getLectoraVar = parseInt(mark);Remember it only passes strings back and forth so if you need it in number form you'll have to use parseInt to convert the string to a number. Hope that helps.
Discussions have been disabled for this post