import ExploreTab; import com.vitesselearning.coursedesign.engine.pagetype.Pagetype; import com.vitesselearning.coursedesign.ui.AudioManager; import com.vitesselearning.coursedesign.utilities.*; import com.vitesselearning.coursedesign.debug.*; /** * @author Apolo Pena * @author * @version 1.0.1 * @description Learner explores pieces of text in a table by clicking to view tabbed content * */ class ExploreTableTab extends ExploreTab { // The frame label for the selected template. public var templateType:String; // style name that dictates a clickable cell in a table private var clickableItemStyle:String = "tableCellExplore"; // used to detect when all items have been clicked private var indexArray:Array; // flag to make sure last OSD is only displayed once private var isLastOsdDisplayed:Boolean = false; /** * Constructor envokes it's parent constructor * */ public function ExploreTableTab(timeline:MovieClip) { super(timeline); } /** * Determine which layout style should be displayed. * */ public function setTemplateType():Void { templateType = String(pageData.page[0].frameLabel[0]); course.userInterface.enableNav(); timeline.gotoAndPlay(templateType); } /** * updates the itemIndex * @param evt an event object */ public function onRelease(evt:Object):Void { // the parent class requires that you manage the itemIndex value or it will always be zero, also this must be set itemIndex = evt.exploreIndex; indexArray[itemIndex].isClicked = true; // show the second OSD when appropriate, but never refresh the OSD again if (isAllCellsClicked() && !isLastOsdDisplayed) { isLastOsdDisplayed = true; showOSD(GlobalText.getGlobalOsd("click_next")); } updateTabs(itemIndex); timeline.contentWindow_mc.selectTabIndex(0); } /** * determines if all the cells in a table have been clicked, you must set indexArray[itemIndex].isClicked = true whenever a cell is clicked for this method to work correctly * */ private function isAllCellsClicked():Boolean { var len:Number = indexArray.length; for (var i = 0; i