home *** CD-ROM | disk | FTP | other *** search
/ FCE Gold Plus / GOLD.iso / pc / main.swf / scripts / __Packages / UnitData.as < prev   
Text File  |  2007-11-02  |  30KB  |  818 lines

  1. class UnitData extends Friends_navigation
  2. {
  3.    var unit = new Array();
  4.    var textFieldArr = new Array();
  5.    var movieClips = ["","btn_secondpage","btn_activitypage"];
  6.    function UnitData(nonGAB, theGAB)
  7.    {
  8.       super();
  9.       this.unit = [];
  10.       this.currentPage = 0;
  11.       this.theNonGABmc = nonGAB;
  12.       this.theGABmc = theGAB;
  13.       this.firstPage = _root.firstPage;
  14.       this.unitInfo = _root.unitInfo;
  15.       this.secondPage = _root.secondPage;
  16.       this.activityPage = _root.activityPage;
  17.       this.baseNav = _root.baseNav;
  18.       this.topNav = _root.topNav;
  19.       this.firstPage._visible = false;
  20.       this.secondPage._visible = false;
  21.       this.theGABmc._visible = false;
  22.       this.theNonGABmc._visible = false;
  23.       this.baseNav._visible = false;
  24.       this.activityPage.theTitle.embedFonts = true;
  25.       this.activityPage.theRubric.embedFonts = true;
  26.       this.activityPage.theRubric.autoSize = true;
  27.       this.activityPage.unitTitleTxtObj1.embedFonts = true;
  28.       this.activityPage.unitTitleTxtObj2.embedFonts = true;
  29.       this.activityPage._visible = false;
  30.       this.secondPageStartX = this.secondPage.dummy._x;
  31.       this.secondPageStartY = this.secondPage.dummy._y;
  32.       this.secondPage.dummy.swapDepths(0);
  33.       this.secondPage.dummy.removeMovieClip();
  34.       this.secondPage.spSecondPage.setStyle("borderStyle","none");
  35.       this.secondPage.spSecondPage.setStyle("backgroundColor",_root.bgColour);
  36.       this.initTopNavBtns();
  37.       this.disablePrintBtn();
  38.    }
  39.    function getNavArr(arr)
  40.    {
  41.       this.arrData = arr;
  42.       this.fillFirstPage();
  43.    }
  44.    function clearActivities()
  45.    {
  46.       var _loc4_ = this.theNonGABmc._name;
  47.       var _loc3_ = this.theNonGABmc._parent;
  48.       this.clearMovies("textFieldArr");
  49.       this.activityPage.theTitle.text = "";
  50.       this.activityPage.theRubric.text = "";
  51.       this.theNonGABmc.swapDepths(0);
  52.       this.theNonGABmc.removeMovieClip();
  53.       this.theNonGABmc = _loc3_.createEmptyMovieClip(_loc4_,_loc3_.getNextHighestDepth());
  54.       this.theGABmc.unloadActivity();
  55.       this.theNonGABmc._visible = false;
  56.       _root.activityPage._visible = false;
  57.       _root.baseNav._visible = false;
  58.       this.theGABmc._visible = false;
  59.    }
  60.    function activityOnLoad(nodeData)
  61.    {
  62.       this.fileData = nodeData;
  63.       if(!nodeData.dictionary)
  64.       {
  65.          this.clearActivities();
  66.       }
  67.       if(!nodeData.arrActivities)
  68.       {
  69.          this.firstPage._visible = false;
  70.          this.secondPage._visible = false;
  71.          this.currentPage = 3;
  72.          _root.loadActivities(nodeData);
  73.       }
  74.       else
  75.       {
  76.          this.firstPage._visible = false;
  77.          this.secondPage._visible = true;
  78.          this.activityPage._visible = false;
  79.          this.currentPage = 2;
  80.          _root.loadActivities(nodeData);
  81.       }
  82.    }
  83.    function activityLoadComplete(fileData)
  84.    {
  85.       if(fileData.header)
  86.       {
  87.          if(fileData.header.split(" - ")[1] != undefined)
  88.          {
  89.             this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font> " + fileData.header.split(" - ")[1];
  90.          }
  91.          else if(fileData.header.split(" ΓÇô ")[1] != undefined)
  92.          {
  93.             this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font> " + fileData.header.split(" ΓÇô ")[1];
  94.          }
  95.          else
  96.          {
  97.             this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font> " + fileData.header;
  98.          }
  99.          if(fileData.rubric)
  100.          {
  101.             this.activityPage.theRubric.htmlText = fileData.rubric;
  102.          }
  103.       }
  104.       if(this.currentPage == 3)
  105.       {
  106.          if(!(fileData.link.url == "activities.swf" || fileData == undefined))
  107.          {
  108.             this.initBaseNav(fileData);
  109.             this.initTopNavBtns();
  110.          }
  111.       }
  112.       if(fileData.link.url == "grammar.swf" || fileData.link.url == "grammarActivities.swf")
  113.       {
  114.          this.disablePrintBtn();
  115.       }
  116.       else if(fileData.link.url == "preview.swf")
  117.       {
  118.          this.theGABContent.theTitleScrollPane._visible = false;
  119.          trace(this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" - ")[1]);
  120.          var _loc4_ = new Color(this.theGABContent.theHeaderSeparator);
  121.          _loc4_.setRGB(_root.lineColour);
  122.          if(this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" - ")[1] != undefined)
  123.          {
  124.             this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font>: " + this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" - ")[1];
  125.          }
  126.          else if(this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" ΓÇô ")[1] != undefined)
  127.          {
  128.             this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font>: " + this.theGABContent.theTitleScrollPane.spContentHolder.theTextField.htmlText.split(" ΓÇô ")[1];
  129.          }
  130.          else
  131.          {
  132.             this.activityPage.theTitle.htmlText = "<font color=\"#" + _root.headerTypeColour + "\">" + fileData.label + "</font>";
  133.          }
  134.          if(this.theGABContent.theRubricScrollPane.spContentHolder.theTextField.text != "")
  135.          {
  136.             this.activityPage.theRubric.htmlText = this.theGABContent.theRubricScrollPane.spContentHolder.theTextField.htmlText;
  137.          }
  138.          if(fileData.label == "Language Quiz")
  139.          {
  140.             this.activityPage.unitTitleTxtObj1.text = "Quiz";
  141.          }
  142.          this.theGABmc._visible = true;
  143.       }
  144.       if(this.currentPage == 3)
  145.       {
  146.          this.activityPage._visible = true;
  147.       }
  148.    }
  149.    function getUnitNumber(str)
  150.    {
  151.       return "Module " + Number(str.substring(3,5));
  152.    }
  153.    function initRollOvers(btn)
  154.    {
  155.       btn.onRollOver = function()
  156.       {
  157.          this.gotoAndStop(2);
  158.       };
  159.       btn.onRollOut = function()
  160.       {
  161.          this.gotoAndStop(1);
  162.       };
  163.       btn.onReleaseOutside = function()
  164.       {
  165.          this.gotoAndStop(1);
  166.       };
  167.    }
  168.    function theCheckButtonPress()
  169.    {
  170.       this.theGABContent.theCheckButton.onPress();
  171.    }
  172.    function theShowButtonPress()
  173.    {
  174.       this.theGABContent.theShowButton.onPress();
  175.       this.theNonGABmc.showBtn.onRelease();
  176.    }
  177.    function theRestartButtonPress()
  178.    {
  179.       this.theGABContent.theRestartButton.onPress();
  180.       this.theNonGABmc.resetBtn.onRelease();
  181.    }
  182.    function thePlayAllButtonPress()
  183.    {
  184.       this.theGABContent.thePlayAllButton.onRelease();
  185.    }
  186.    function onScores(correct, total)
  187.    {
  188.       this.baseNav.theScore._visible = true;
  189.       this.baseNav.theScore.score = correct + "/" + total;
  190.       var _loc3_ = {};
  191.       _loc3_.baseNav = this.baseNav;
  192.       _loc3_.theGABContent = this.theGABContent;
  193.       _loc3_.onMouseDown = function()
  194.       {
  195.          if(!this.theGABContent.theScrollPane.vSB.hitTest(_root._xmouse,_root._ymouse))
  196.          {
  197.             this.baseNav.theScore._visible = false;
  198.             Mouse.removeListener(this);
  199.          }
  200.       };
  201.       Mouse.addListener(_loc3_);
  202.    }
  203.    function initBaseNav(nodeData)
  204.    {
  205.       var manager = this;
  206.       this.baseNav.nodeData = nodeData;
  207.       this.baseNav._visible = true;
  208.       this.baseNav.theScore._visible = false;
  209.       this.theGABContent = this.theGABmc.activityManager_mc.assetsHolder_mc.content_mc.depthChild0;
  210.       this.initRollOvers(this.baseNav.thePlayAllButton);
  211.       this.initRollOvers(this.baseNav.theCheckButton);
  212.       this.initRollOvers(this.baseNav.theShowButton);
  213.       this.initRollOvers(this.baseNav.theRestartButton);
  214.       this.baseNav.theCheckButton._visible = false;
  215.       this.baseNav.theShowButton._visible = false;
  216.       this.baseNav.theRestartButton._visible = false;
  217.       this.baseNav.thePlayAllButton._visible = false;
  218.       this.baseNav.theCheckButton.theGABContent = this.theGABContent;
  219.       this.baseNav.theShowButton.theGABContent = this.theGABContent;
  220.       this.baseNav.theRestartButton.theGABContent = this.theGABContent;
  221.       this.baseNav.thePlayAllButton.theGABContent = this.theGABContent;
  222.       this.baseNav.theCheckButton.theNonGABmc = this.theNonGABmc;
  223.       this.baseNav.theShowButton.theNonGABmc = this.theNonGABmc;
  224.       this.baseNav.theRestartButton.theNonGABmc = this.theNonGABmc;
  225.       this.baseNav.thePlayAllButton.theNonGABmc = this.theNonGABmc;
  226.       if(nodeData.link.url == "preview.swf")
  227.       {
  228.          this.theGABContent.theScore._visible = false;
  229.          if(this.theGABContent.thePlayAllButton._visible)
  230.          {
  231.             this.theGABContent.thePlayAllButton._visible = false;
  232.             this.baseNav.thePlayAllButton._visible = true;
  233.             this.baseNav.thePlayAllButton.onRelease = manager.thePlayAllButtonPress;
  234.          }
  235.          if(this.theGABContent.theCheckButton._visible)
  236.          {
  237.             this.theGABContent.theCheckButton._visible = false;
  238.             this.baseNav.theCheckButton._visible = true;
  239.             this.baseNav.theCheckButton.onPress = manager.theCheckButtonPress;
  240.          }
  241.          if(this.theGABContent.theShowButton._visible)
  242.          {
  243.             this.theGABContent.theShowButton._visible = false;
  244.             this.baseNav.theShowButton._visible = true;
  245.             this.baseNav.theShowButton.onPress = manager.theShowButtonPress;
  246.          }
  247.          if(this.theGABContent.theRestartButton._visible)
  248.          {
  249.             this.theGABContent.theRestartButton._visible = false;
  250.             this.baseNav.theRestartButton._visible = true;
  251.             this.baseNav.theRestartButton.onPress = manager.theRestartButtonPress;
  252.          }
  253.       }
  254.       else if(nodeData.link.url == "wordsearch.swf")
  255.       {
  256.          this.theNonGABmc.showBtn._visible = false;
  257.          this.baseNav.theShowButton.onPress = manager.theShowButtonPress;
  258.          this.theNonGABmc.resetBtn._visible = false;
  259.          this.baseNav.theRestartButton.onPress = manager.theRestartButtonPress;
  260.       }
  261.       this.initRollOvers(this.baseNav.next);
  262.       this.initRollOvers(this.baseNav.back);
  263.       this.initRollOvers(this.baseNav.home);
  264.       this.baseNav.next._visible = false;
  265.       this.baseNav.back._visible = false;
  266.       this.baseNav.home._visible = false;
  267.       if(nodeData.nodePath[0] == 0)
  268.       {
  269.          this.baseNav.home._visible = true;
  270.       }
  271.       this.baseNav.home.unitText.embedFonts = true;
  272.       this.baseNav.home.unit = nodeData.nodePath[1];
  273.       this.baseNav.home.unitText.text = "Module " + (nodeData.nodePath[1] + 1);
  274.       this.baseNav.home.onRelease = function()
  275.       {
  276.          _root.navigation.unitBtnClicked(this.unit,true);
  277.       };
  278.       var manager = this;
  279.       if(!nodeData.isActivity)
  280.       {
  281.          this.nodeDataNext = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),1);
  282.          this.nodeDataCurr = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),0);
  283.          this.nodeDataPrev = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),-1);
  284.          if(nodeData.refNo == 0)
  285.          {
  286.             this.baseNav.back.unit = nodeData.nodePath[1];
  287.             if(nodeData.nodePath[0] == 0)
  288.             {
  289.                this.baseNav.back._visible = true;
  290.                this.baseNav.back.onRelease = function()
  291.                {
  292.                   _root.navigation.unitBtnClicked(this.unit,true);
  293.                };
  294.             }
  295.          }
  296.          else
  297.          {
  298.             this.baseNav.back._visible = true;
  299.             this.baseNav.back.onRelease = function()
  300.             {
  301.                var _loc2_ = {};
  302.                _loc2_.nodeData = manager.nodeDataPrev;
  303.                _root.navigation.onFileClicked(_loc2_,false);
  304.             };
  305.          }
  306.          if(this.nodeDataNext != undefined)
  307.          {
  308.             this.baseNav.next._visible = true;
  309.             this.baseNav.next.onRelease = function()
  310.             {
  311.                var _loc2_ = {};
  312.                _loc2_.nodeData = manager.nodeDataNext;
  313.                _root.navigation.onFileClicked(_loc2_,false);
  314.             };
  315.          }
  316.       }
  317.       else
  318.       {
  319.          this.nodeDataNext = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),1);
  320.          this.nodeDataCurr = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),0);
  321.          this.nodeDataPrev = _root.navigation.getUnitInfo(nodeData.nodePath.slice(),-1);
  322.          if(nodeData.refNo == 0)
  323.          {
  324.             if(nodeData.nodePath[0] == 0)
  325.             {
  326.                this.baseNav.back._visible = true;
  327.                this.baseNav.back.onRelease = function()
  328.                {
  329.                   var _loc2_ = {};
  330.                   _loc2_.nodeData = manager.nodeDataCurr;
  331.                   _root.navigation.unitBtnClicked(_loc2_.nodeData.nodePath[1] + 1);
  332.                };
  333.             }
  334.          }
  335.          else
  336.          {
  337.             this.baseNav.back._visible = true;
  338.             this.baseNav.back.onRelease = function()
  339.             {
  340.                var _loc2_ = {};
  341.                _loc2_.nodeData = manager.nodeDataPrev;
  342.                _root.onFileClicked(_loc2_.nodeData);
  343.             };
  344.          }
  345.          if(this.nodeDataNext != undefined)
  346.          {
  347.             this.baseNav.next._visible = true;
  348.             this.baseNav.next.onRelease = function()
  349.             {
  350.                var _loc2_ = {};
  351.                _loc2_.nodeData = manager.nodeDataNext;
  352.                _root.onFileClicked(_loc2_.nodeData);
  353.             };
  354.          }
  355.       }
  356.    }
  357.    function disablePrintBtn()
  358.    {
  359.       this.topNav.printBtn.useHandCursor = false;
  360.       this.topNav.printBtn.onRelease = undefined;
  361.       this.topNav.printBtn.onRollOver = undefined;
  362.       this.topNav.printBtn.onRollOut = undefined;
  363.       this.topNav.printBtn.onReleaseOutside = undefined;
  364.    }
  365.    function initTopNavBtns()
  366.    {
  367.       var manager = this;
  368.       _root.btnHomeAni.home.useHandCursor = false;
  369.       this.topNav.quitBtn.onRelease = function()
  370.       {
  371.          manager.activityOnLoad(undefined);
  372.          _root.navigation.disable();
  373.          manager.topNav.quitBtn.onRelease = false;
  374.          manager.topNav.dictionary._visible = false;
  375.          manager.topNav.printBtn.onRelease = false;
  376.          _root.gotoAndStop(2);
  377.       };
  378.       this.initRollOvers(this.topNav.quitBtn);
  379.       this.initRollOvers(this.topNav.dictionary);
  380.       this.topNav.dictionary.onRelease = function()
  381.       {
  382.          if(!(manager.currentPage == 3 && _root.extension._currentframe != 10))
  383.          {
  384.             _root.activity_holder.activityGram.swapDepths(0);
  385.             _root.activity_holder.activityGram.removeMovieClip();
  386.             manager.activityOnLoad({dictionary:true});
  387.             if(_root.currentHolder)
  388.             {
  389.                trace("Current holder: " + _root.currentHolder);
  390.                manager.baseNav._visible = true;
  391.                manager.baseNav.reference1._visible = false;
  392.                manager.baseNav.reference2._visible = false;
  393.                manager.baseNav.reference3._visible = false;
  394.                manager.baseNav.next._visible = false;
  395.                manager.baseNav.back.onRelease = function()
  396.                {
  397.                   _root.currentHolder._visible = true;
  398.                   if(_root.headerActive)
  399.                   {
  400.                      _root.activityHeader._visible = true;
  401.                   }
  402.                   _root.activity_holder.dictionary.swapDepths(0);
  403.                   _root.activity_holder.dictionary.removeMovieClip();
  404.                   manager.initBaseNav(manager.baseNav.nodeData);
  405.                };
  406.             }
  407.          }
  408.       };
  409.       this.initRollOvers(this.topNav.printBtn);
  410.       this.topNav.printBtn.theGABContent = this.theGABContent;
  411.       this.topNav.printBtn.useHandCursor = true;
  412.       this.topNav.printBtn.onRelease = function()
  413.       {
  414.          var _loc6_ = undefined;
  415.          _root.printCov._visible = true;
  416.          var _loc10_ = undefined;
  417.          var _loc9_ = undefined;
  418.          var _loc3_ = new Array();
  419.          if(_root.printObj.gab)
  420.          {
  421.             _loc6_ = _root.printObj.path.activityManager_mc;
  422.             var _loc4_ = this.theGABContent.theScrollPane.height;
  423.             var _loc5_ = this.theGABContent.theScrollPane._height + 5;
  424.             var _loc8_ = 975 - this.theGABContent.theScrollPane._y;
  425.             this.theGABContent.theTitleScrollPane._visible = true;
  426.             this.theGABContent.theRubricScrollPane._visible = true;
  427.             if(_loc5_ > _loc4_ + 1)
  428.             {
  429.                _loc9_ = this.theGABContent.theScrollPane.vPosition;
  430.                this.theGABContent.theScrollPane.vPosition = 0;
  431.                this.theGABContent.theScrollPane._yscale = _loc5_ / _loc4_ * 100;
  432.                this.theGABContent.theScrollPane.spContentHolder._yscale = _loc4_ / _loc5_ * 100;
  433.                if(_loc8_ / _loc5_ < 1)
  434.                {
  435.                   this.theGABContent.theScrollPane.spContentHolder._yscale *= _loc8_ / _loc5_;
  436.                   this.theGABContent.theScrollPane.spContentHolder._xscale *= _loc8_ / _loc5_;
  437.                   _loc10_ = _loc8_ - _loc4_;
  438.                }
  439.                else
  440.                {
  441.                   _loc10_ = 100 * _loc4_ / this.theGABContent.theScrollPane.spContentHolder._yscale - _loc4_;
  442.                }
  443.                this.theGABContent.theScrollPane.vScrollPolicy = "off";
  444.             }
  445.             _loc3_ = [this.theGABContent.theCheckButton._visible,this.theGABContent.theShowButton._visible,this.theGABContent.theRestartButton._visible,this.theGABContent.thePlayAllButton._visible,this.theGABContent.theScore._visible];
  446.             if(_loc3_[0])
  447.             {
  448.                this.theGABContent.theCheckButton._visible = false;
  449.             }
  450.             if(_loc3_[1])
  451.             {
  452.                this.theGABContent.theShowButton._visible = false;
  453.             }
  454.             if(_loc3_[2])
  455.             {
  456.                this.theGABContent.theRestartButton._visible = false;
  457.             }
  458.             if(_loc3_[3])
  459.             {
  460.                this.theGABContent.thePlayAllButton._visible = false;
  461.             }
  462.             if(_loc3_[4])
  463.             {
  464.                this.theGABContent.theScore._visible = false;
  465.             }
  466.          }
  467.          else
  468.          {
  469.             _loc6_ = _root.printObj.path;
  470.          }
  471.          _loc6_._xscale = _root.printObj.scale;
  472.          _loc6_._yscale = _root.printObj.scale;
  473.          var _loc7_ = new PrintJob();
  474.          if(_loc7_.start())
  475.          {
  476.             _loc7_.addPage(_loc6_,{xMin:0,xMax:800,yMin:0,yMax:1200},null,1);
  477.             _loc7_.send();
  478.          }
  479.          false;
  480.          if(_root.printObj.gab)
  481.          {
  482.             if(_loc3_[0] != undefined)
  483.             {
  484.                this.theGABContent.theCheckButton._visible = _loc3_[0];
  485.             }
  486.             if(_loc3_[1] != undefined)
  487.             {
  488.                this.theGABContent.theShowButton._visible = _loc3_[1];
  489.             }
  490.             if(_loc3_[2] != undefined)
  491.             {
  492.                this.theGABContent.theRestartButton._visible = _loc3_[2];
  493.             }
  494.             if(_loc3_[3] != undefined)
  495.             {
  496.                this.theGABContent.thePlayAllButton._visible = _loc3_[3];
  497.             }
  498.             if(_loc3_[4] != undefined)
  499.             {
  500.                this.theGABContent.theScore._visible = _loc3_[4];
  501.             }
  502.             if(_loc5_ > _loc4_ + 1)
  503.             {
  504.                this.theGABContent.theScrollPane._yscale = 100;
  505.                this.theGABContent.theScrollPane.spContentHolder._yscale = 100;
  506.                this.theGABContent.theScrollPane.spContentHolder._xscale = 100;
  507.                this.theGABContent.theScrollPane.vPosition = _loc9_;
  508.                this.theGABContent.theScrollPane.vScrollPolicy = "auto";
  509.             }
  510.             this.theGABContent.theTitleScrollPane._visible = false;
  511.             this.theGABContent.theRubricScrollPane._visible = false;
  512.          }
  513.          _loc6_._xscale = 100;
  514.          _loc6_._yscale = 100;
  515.          _root.printCov._visible = false;
  516.       };
  517.    }
  518.    function fillInformation(id, firstcall)
  519.    {
  520.       this.firstPage._visible = true;
  521.       this.firstPage.gotoAndPlay(2);
  522.    }
  523.    function searchArr(arr, val)
  524.    {
  525.       var _loc2_ = arr.length;
  526.       var _loc1_ = 0;
  527.       while(_loc1_ < _loc2_)
  528.       {
  529.          if(arr[_loc1_] == val)
  530.          {
  531.             return true;
  532.          }
  533.          _loc1_ = _loc1_ + 1;
  534.       }
  535.       return false;
  536.    }
  537.    function attachMC(linkage, x, y, mcData, id)
  538.    {
  539.       var _loc3_ = this.secondPage.spSecondPage.content.attachMovie(this.movieClips[linkage],"mc_" + this.count,this.count + 1);
  540.       this.activeMovieClips[this.count] = _loc3_;
  541.       var _loc7_ = this;
  542.       if(linkage == 0)
  543.       {
  544.          _loc3_.header.embedFonts = true;
  545.          _loc3_.header.htmlText = mcData;
  546.       }
  547.       else if(linkage == 1)
  548.       {
  549.          _loc3_.nodeData = mcData;
  550.          _loc3_.rollo._visible = false;
  551.          _loc3_.rolloFrame = 2;
  552.          _loc3_.label = mcData.label;
  553.          if(mcData.name)
  554.          {
  555.             _loc3_.actName = mcData.name;
  556.          }
  557.          _loc3_.txtLabel.embedFonts = true;
  558.          _loc3_.txtName.embedFonts = true;
  559.          _loc3_.txtLabel.html = true;
  560.          _loc3_.txtName.html = true;
  561.          _loc3_.onRollOver = function()
  562.          {
  563.             this.gotoAndStop(this.rolloFrame);
  564.             this.txtLabel.embedFonts = true;
  565.             this.txtName.embedFonts = true;
  566.          };
  567.          _loc3_.onRelease = function()
  568.          {
  569.             this.rollo._visible = false;
  570.             var _loc3_ = {};
  571.             _loc3_.nodeData = this.nodeData;
  572.             _root.navigation.onFileClicked(_loc3_,false);
  573.          };
  574.          _loc3_.onRollOut = function()
  575.          {
  576.             this.gotoAndStop(1);
  577.             this.txtLabel.embedFonts = true;
  578.             this.txtName.embedFonts = true;
  579.          };
  580.          _loc3_.onReleaseOutside = function()
  581.          {
  582.             this.gotoAndStop(1);
  583.             this.txtLabel.embedFonts = true;
  584.             this.txtName.embedFonts = true;
  585.          };
  586.          _loc3_.useHandCursor = false;
  587.       }
  588.       else if(linkage == 2)
  589.       {
  590.          _loc3_.nodeData = mcData;
  591.          _loc3_.rollo._visible = false;
  592.          _loc3_.rolloFrame = 2;
  593.          _loc3_.actName = mcData.fullName;
  594.          _loc3_.txtName.embedFonts = true;
  595.          _loc3_.txtName.html = true;
  596.          _loc3_.onRollOver = function()
  597.          {
  598.             this.gotoAndStop(this.rolloFrame);
  599.             this.txtName.embedFonts = true;
  600.          };
  601.          _loc3_.onRelease = function()
  602.          {
  603.             this.rollo._visible = false;
  604.             var _loc3_ = {};
  605.             _loc3_.nodeData = this.nodeData;
  606.             _root.navigation.onFileClicked(_loc3_,false);
  607.          };
  608.          _loc3_.onRollOut = function()
  609.          {
  610.             this.gotoAndStop(1);
  611.             this.txtName.embedFonts = true;
  612.          };
  613.          _loc3_.onReleaseOutside = function()
  614.          {
  615.             this.gotoAndStop(1);
  616.             this.txtName.embedFonts = true;
  617.          };
  618.          _loc3_.useHandCursor = false;
  619.       }
  620.       this.count = this.count + 1;
  621.       _loc3_._x = x;
  622.       _loc3_._y = y;
  623.    }
  624.    function makeUnitDisplay(id)
  625.    {
  626.       if(this.currentPage != 2)
  627.       {
  628.       }
  629.    }
  630.    function createUnitNav(id)
  631.    {
  632.       var _loc3_ = this.arrData[id].arrSubSections;
  633.       var _loc5_ = this.arrData[id].label;
  634.       var _loc7_ = this;
  635.       var _loc4_ = 32;
  636.       this.currentUnit = id;
  637.       this.secondPage._visible = true;
  638.       this.secondPage.unitTitleTxtObj1.embedFonts = true;
  639.       this.secondPage.unitTitleTxtObj2.embedFonts = true;
  640.       this.secondPage.theUnitTitle = _loc5_;
  641.       this.activityPage.theUnitTitle = _loc5_;
  642.       this.clearMovies("activeMovieClips");
  643.       this.count = 0;
  644.       var _loc2_ = 0;
  645.       while(_loc2_ < _loc3_.length)
  646.       {
  647.          this.attachMC(1,0,_loc2_ * _loc4_ + 30,_loc3_[_loc2_]);
  648.          _loc2_ = _loc2_ + 1;
  649.       }
  650.       this.secondPage.spSecondPage.setStyle("borderStyle","none");
  651.       this.currentPage = 2;
  652.    }
  653.    function createActivityNav(activityData, nodePath)
  654.    {
  655.       var _loc4_ = activityData.arrSubSections;
  656.       var _loc3_ = 0;
  657.       while(_loc3_ < _loc4_.length)
  658.       {
  659.          var _loc5_ = new Array();
  660.          _loc5_ = nodePath.slice();
  661.          _loc5_.push(_loc4_[_loc3_].refNo);
  662.          _loc4_[_loc3_].nodePath = _loc5_;
  663.          _loc3_ = _loc3_ + 1;
  664.       }
  665.       var _loc8_ = activityData.label;
  666.       var _loc10_ = this;
  667.       var _loc6_ = 32;
  668.       if(this.currentType != _loc8_)
  669.       {
  670.          this.secondPage.spSecondPage.vPosition = 0;
  671.       }
  672.       this.currentType = _loc8_;
  673.       this.secondPage._visible = true;
  674.       this.secondPage.unitTitleTxtObj1.embedFonts = true;
  675.       this.secondPage.unitTitleTxtObj2.embedFonts = true;
  676.       this.secondPage.theUnitTitle = "Activities: " + _loc8_;
  677.       this.activityPage.theUnitTitle = "Activities: " + _loc8_;
  678.       this.clearMovies("activeMovieClips");
  679.       this.count = 0;
  680.       _loc3_ = 0;
  681.       while(_loc3_ < _loc4_.length)
  682.       {
  683.          this.attachMC(2,500,_loc3_ * _loc6_ + 30,_loc4_[_loc3_]);
  684.          _loc3_ = _loc3_ + 1;
  685.       }
  686.       this.secondPage.spSecondPage.setStyle("borderStyle","none");
  687.       this.secondPage.spSecondPage.setStyle("backgroundColor",_root.bgColour);
  688.       this.currentPage = 2;
  689.    }
  690.    function homeBtnPress()
  691.    {
  692.       if(this.currentPage != 0)
  693.       {
  694.          this.clearActivities();
  695.          this.currentUnit = undefined;
  696.          this.mainBg._visible = true;
  697.          this.firstPage._visible = true;
  698.          this.secondPage._visible = false;
  699.          this.topNav.printBtn.onRelease = undefined;
  700.          this.topNav.printBtn.useHandCursor = false;
  701.       }
  702.       this.currentPage = 0;
  703.    }
  704.    function unitBtnPress(id)
  705.    {
  706.       this.clearActivities();
  707.       _root.currId = id;
  708.       this.mainBg._visible = true;
  709.       this.firstPage._visible = false;
  710.       this.activityPage._visible = false;
  711.       this.baseNav._visible = false;
  712.       this.createUnitNav(id);
  713.       this.disablePrintBtn();
  714.    }
  715.    function selectMenuItem(str)
  716.    {
  717.       var _loc2_ = {};
  718.       _loc2_ = _root.navigation.getUnitInfo(str.split(","));
  719.       var _loc3_ = {};
  720.       _loc3_.nodeData = _loc2_;
  721.       _root.navigation.onFileClicked(_loc3_,false);
  722.    }
  723.    function clearMovies(arrStr)
  724.    {
  725.       var _loc2_ = 0;
  726.       while(_loc2_ < this[arrStr].length)
  727.       {
  728.          this[arrStr][_loc2_].swapDepths(0);
  729.          this[arrStr][_loc2_].removeTextField();
  730.          this[arrStr][_loc2_].removeMovieClip();
  731.          _loc2_ = _loc2_ + 1;
  732.       }
  733.       this[arrStr] = new Array();
  734.    }
  735.    function initUnitBtn(id)
  736.    {
  737.       var _loc3_ = this;
  738.       this.firstPage["u" + id].id = id;
  739.       this.firstPage["u" + id].txtObj.embedFonts = true;
  740.       this.firstPage["u" + id].rolledOver = false;
  741.       this.firstPage["u" + id].txtObj.text = this.arrData[id].label;
  742.       this.firstPage["u" + id].onRelease = function()
  743.       {
  744.          _root.secondPage.unitPicture.gotoAndStop(id);
  745.          _root.navigation.unitBtnClicked(this.id);
  746.       };
  747.       this.firstPage["u" + id].onRollOver = function()
  748.       {
  749.          this.gotoAndStop(2);
  750.          _root.firstPage.firstPagePicture.gotoAndStop(id);
  751.          this.txtObj.embedFonts = true;
  752.       };
  753.       this.firstPage["u" + id].onRollOut = function()
  754.       {
  755.          this.gotoAndStop(1);
  756.          this.txtObj.embedFonts = true;
  757.       };
  758.       this.firstPage["u" + id].onReleaseOutside = function()
  759.       {
  760.          this.gotoAndStop(1);
  761.          this.txtObj.embedFonts = true;
  762.       };
  763.       this.firstPage["u" + id].useHandCursor = false;
  764.    }
  765.    function fillFirstPage()
  766.    {
  767.       var _loc4_ = 0;
  768.       var _loc7_ = this.arrData.length;
  769.       this.firstPage._visible = true;
  770.       this.unitBtnTmpArr = new Array();
  771.       var _loc5_ = this.firstPage.dummy._x;
  772.       var _loc8_ = this.firstPage.dummy._y;
  773.       var _loc6_ = 50;
  774.       this.firstPage.dummy.swapDepths(0);
  775.       this.firstPage.dummy.removeMovieClip();
  776.       var _loc3_ = 0;
  777.       while(_loc3_ < _loc7_)
  778.       {
  779.          this.unitBtnTmpArr.push(_loc3_);
  780.          if(this.arrData[_loc3_].bFolder || this.arrData[_loc3_].label == "iTest")
  781.          {
  782.             if(this.arrData[_loc3_].bFolder)
  783.             {
  784.                this.firstPage.attachMovie("unitBtn","u" + _loc3_,this.firstPage.getNextHighestDepth());
  785.                if(_loc8_ + _loc4_ * _loc6_ > _loc7_ / 2 * _loc6_)
  786.                {
  787.                   _loc5_ += 200;
  788.                   _loc4_ = 0;
  789.                }
  790.                this.firstPage["u" + _loc3_]._x = _loc5_;
  791.                this.firstPage["u" + _loc3_]._y = _loc8_ + _loc4_ * _loc6_;
  792.                _loc4_ = _loc4_ + 1;
  793.             }
  794.             else
  795.             {
  796.                trace("unitbtn2");
  797.                this.firstPage.attachMovie("unitBtn2","u" + _loc3_,this.firstPage.getNextHighestDepth());
  798.                this.firstPage["u" + _loc3_]._x = _loc5_;
  799.                this.firstPage["u" + _loc3_]._y = _root.firstPage.firstPagePicture._y;
  800.             }
  801.          }
  802.          this.initUnitBtn(_loc3_);
  803.          _loc3_ = _loc3_ + 1;
  804.       }
  805.       this.currentPage = 1;
  806.    }
  807.    function parseXML(XMLObj)
  808.    {
  809.       var _loc2_ = 0;
  810.       while(_loc2_ < XMLObj.firstChild.childNodes.length)
  811.       {
  812.          this.arrData[_loc2_].modName = XMLObj.firstChild.childNodes[_loc2_].attributes.title;
  813.          this.arrData[_loc2_].description = XMLObj.firstChild.childNodes[_loc2_].firstChild.nodeValue;
  814.          _loc2_ = _loc2_ + 1;
  815.       }
  816.    }
  817. }
  818.