Since people have been asking me about it, here are some common Flash commands for communicating with Lectora that I use.
I will use a generic “objectname” that you can can replace with the HTML name that Lectora assigns.
Note 2: you need this code on the pages where you use these functions: import.flash.external.*
List: Hide an object: ExternalInterface.call(“objectname.actionHide()”); Show an object: ExternalInterface.call(“objectname.actionShow()”); Next Page: ExternalInterface.call(“trivNextPage()”); Previous Page: ExternalInterface.call(“trivPrevPage()”); Go to a Specific Page in Lectora (see page name rules):ExternalInterface.call(“trivExitPage(‘htmlpagename.html’, true)”); Move an Object on stage (xval=the new xcoordinates, yval=the new ycoordinates): ExternalInterface.call(“objectname.objLyr.moveTo(xval,yval)” );
Talk to another Flash object (using Lectora’s tools, I know there are other ways), set variable: ExternalInterface.call(“objectname.setFlashVar(‘thevariable’ ,thevalue)”); Grab a value from Lectora and assign it to a variable in Flash:See Mark’s post below. Set a Lectora variable from flash:ExternalInterface.call(“Varvariablename.set(‘value’)”); Run a Lectora Action Group: ExternalInterace.call(“runGroup_objectname()”);
Page Name Rules: You can control page naming by setting up a system of chapeters and sections. Make sure you don’t have duplicate names, or else it will publish as ascii. Example for a SCORM/AICC course:Chapter Name (mod1)Section Name (sec1)Page Name (page1)This structure would give you an html page name as: a001_mod1_sec1_page1.htmlWhere a001 is the assignable unit. Keeping uniformed and controled page naming allows for some neat interactions with flash because you always know where every page is. Let your imagination run wild 🙂 Example: I have created a dynamic flash menu for every page within the course, that also updates based upon your location in the course.Post here if you want me to add any more. I’ll update the post.