Blog

Using Flash/Captivate to Navigate Lectora

Jan 19

Written by:
1/19/2011 2:42 PM  RssIcon

Flash button action for Previous

on(release){
                      getURL (“trivPrevPage()”);
}

Flash button action for Next

on(release){
                      getURL (“trivNextPage()”);
}

Flash button action for Home - or any specific Page (assuming your home is index.html)

on(release){
                      getURL ("trivExitPage('index.html',true)"); 
}

**To go to a specific page replace ‘index.html’ with correct page

Exit button
      
on(release){
        getURL("exitTitle()");
}

Lectora “external HTML object, type: top of file Scripting” ‘test’ being the lectora title name.



Open a New Window (this one isn't for Lectora, but could probably be modified?)

on (release) {
getURL ("NewWindow=window.open('ShowPopup.php','newWin', 'width=400,height=300,left=0,top=0,toolbar=No,location=No,sc rollbars=No,status=No,resizable=No,fullscreen=No'); NewWindow.focus(); void(0);");


Writing/Editing a variable from Flash to Lectora.

getURL("VarVARIABLENAME.set('Yes')");

(Or whatever you want written to the variable...)


Showing/Hiding an image/object from Flash to Lectora.
getURL("OBJECTHTMLNAME.actionShow();");

(Or whatever you want the action to be "show, hide, etc"...)

Flash ActionScript 3.0
Remember that in actionscript 3.0 all script is written to the frames and not the objects such as buttons and movieclips.

Go to Next Page:
function gotoNextPage(event:MouseEvent):void
{
     var url:String = "trivNextPage()";
     var request:URLRequest = new URLRequest(url);
     navigateToURL(request,"_self") ;
}
invButton.addEventListener(MouseEvent.CLICK,gotoNextPage);

Go to Previous Page:
function gotoPreviousPage(event:MouseEvent):void
{
     var url:String = "trivPrevPage()";
     var request:URLRequest = new URLRequest(url);
     navigateToURL(request,"_self") ;
}
invButton.addEventListener(MouseEvent.CLICK,gotoPreviousPage ); (Note: "invButton" is the button instance) (Note: "invButton" is the button instance

Calling from Flash

flash.external.ExternalInterface.call(“command”, optional variable);

Sample Commands, Optional variable, Example
alert , Value to alert “alert”, “Final Page”
action123, n/a, “action80”
trivNextPage , n/a, “trivNextPage”
trivPrevPage, n/a, “trivPrevPage”
Object.actionShow, n/a, “button80.actionShow”
Object.actionHide, n/a, “button80.actionHide”
VarName.getValue, n/a, “VarStudenName.getValue”
VarName.set, Value to set, “VarStudentName.set”, “Bill”

Tip: Don’t put the ‘()’ after the command when calling them in Flash

To get the name of an object in Lectora go to File>Preferences then check the “Show HTML-published object names in object properties” checkbox. Then double-click an object and its name will be in the upper-right corner of the dialogue popup.

Search Blog