home *** CD-ROM | disk | FTP | other *** search
/ FCE Gold Plus / GOLD.iso / pc / shell.swf / scripts / __Packages / com / screen / FIB2.as < prev    next >
Encoding:
Text File  |  2007-10-16  |  26.7 KB  |  825 lines

  1. class com.screen.FIB2
  2. {
  3.    var strTitle;
  4.    var c_strEnvironment;
  5.    var iWidth;
  6.    var _parent;
  7.    var mcOver;
  8.    var strText;
  9.    var objRef;
  10.    var obj;
  11.    var objKeyup;
  12.    var fib;
  13.    var c_fibY;
  14.    var iLineSp = 22;
  15.    var iLevel = 1;
  16.    var btnNo = 0;
  17.    function FIB2()
  18.    {
  19.    }
  20.    function init(_objRef, _title, _text, _wth, x, y, _mcName, _type, _group, _navRef)
  21.    {
  22.       var _loc1_ = this;
  23.       _loc1_.objRef = _objRef;
  24.       _loc1_.strTitle = _title;
  25.       _loc1_.strText = _text;
  26.       _loc1_.iWidth = _wth;
  27.       _loc1_.xLoc = x;
  28.       _loc1_.yLoc = y;
  29.       _loc1_.c_strAthMC = _mcName;
  30.       _loc1_.c_strType = _type;
  31.       _loc1_.c_iGroup = _group;
  32.       _loc1_.c_objNavRef = _navRef;
  33.       _loc1_.c_upperChk = "";
  34.       _loc1_.c_strMode = _loc1_.c_objNavRef.c_objTestRef.c_strMode;
  35.       _loc1_.c_strSkill = _loc1_.c_objNavRef.c_objTestRef.c_strSkill;
  36.       _loc1_.c_objHMObj = _loc1_.c_objNavRef.c_objTestRef.c_hQuestionState;
  37.       _loc1_.c_strEnvironment = com.controller.UICoordinator.getInstance().getOSEnvironment();
  38.       _loc1_.startProcess();
  39.    }
  40.    function removedMovieObject()
  41.    {
  42.       var _loc3_ = this;
  43.       trace("removedMovieObject btnNo :  " + _loc3_.btnNo);
  44.       var _loc2_ = 0;
  45.       while(_loc2_ < _loc3_.btnNo)
  46.       {
  47.          var _loc1_ = _loc3_.objRef.fib["Box" + _loc2_];
  48.          trace(">>>>>>>>>>>>>>>>>>ppppppp box ::::::" + _loc1_);
  49.          Key.removeListener(_loc1_.objkeyUP);
  50.          delete _loc1_.objkeyUP;
  51.          false;
  52.          _loc2_ = _loc2_ + 1;
  53.       }
  54.    }
  55.    function startProcess()
  56.    {
  57.       var _loc1_ = this;
  58.       _loc1_.objRef.mc_feedbackBox._visible = false;
  59.       var mcScrollPane = _loc1_.objRef.attachMovie("FScrollPaneSymbol","mc_ScrollPane",_loc1_.objRef.getNextHighestDepth());
  60.       _loc1_.objRef.mc_ScrollPane.setScrollContent("SP_Content");
  61.       _loc1_.objRef.fib = _loc1_.objRef.mc_ScrollPane.getScrollContent();
  62.       _loc1_.fib = _loc1_.objRef.fib;
  63.       _loc1_.fib._x = _loc1_.xLoc;
  64.       _loc1_.fib._y = _loc1_.yLoc;
  65.       _loc1_.displayTitle();
  66.       _loc1_.displayText();
  67.    }
  68.    function displayTitle()
  69.    {
  70.       var _loc2_ = this;
  71.       trace("????????????????????/ IN TITLE");
  72.       _loc2_.fib.createTextField("title",500,10,0,_loc2_.iWidth,25);
  73.       var _loc1_ = _loc2_.fib.title;
  74.       trace("#################### 1. FIB2 - title : " + _loc1_);
  75.       var _loc3_ = new TextFormat();
  76.       _loc3_.font = "Verdana";
  77.       _loc3_.size = 11;
  78.       _loc3_.color = "0x000000";
  79.       if(_loc2_.c_strEnvironment == "Linux")
  80.       {
  81.          _loc1_.embedFonts = true;
  82.       }
  83.       _loc1_.html = true;
  84.       _loc1_.autoSize = true;
  85.       trace("#################### 2. FIB2 - strTitle.data : " + _loc2_.strTitle.data);
  86.       _loc1_.htmlText = _loc2_.strTitle.data;
  87.       _loc1_.selectable = false;
  88.       _loc1_.setTextFormat(_loc3_);
  89.       false;
  90.       var strAlignment = _loc2_.getAlignment();
  91.       trace("#################### 3. FIB2 - strAlignment : " + strAlignment);
  92.       if(strAlignment == "center")
  93.       {
  94.          _loc1_._x = (_loc2_.iWidth - _loc1_.textWidth) / 2;
  95.          trace("#################### 4. FIB2 - center title._x : " + _loc1_._x);
  96.       }
  97.       else if(strAlignment == "right")
  98.       {
  99.          _loc1_._x = _loc2_.iWidth - _loc1_.textWidth;
  100.          trace("#################### 4. FIB2 - right title._x : " + _loc1_._x);
  101.       }
  102.       _loc1_._y += 10;
  103.    }
  104.    function getAlignment()
  105.    {
  106.       var _loc1_ = this.strTitle.attributes.textAlign;
  107.       return _loc1_;
  108.    }
  109.    function displayText()
  110.    {
  111.       var _loc1_ = this;
  112.       _loc1_.c_arrQuesNos = new Array();
  113.       var arrData = _loc1_.arrangetext();
  114.       var iMC_Width = 0;
  115.       var iMC_X;
  116.       var iMC_Y;
  117.       if(_loc1_.c_strType == "textField")
  118.       {
  119.          iMC_X = 20;
  120.          iMC_Y = 12;
  121.       }
  122.       else if(_loc1_.c_strType == "Button")
  123.       {
  124.          iMC_X = 10;
  125.          iMC_Y = 42;
  126.       }
  127.       else
  128.       {
  129.          iMC_X = 10;
  130.          iMC_Y = 5;
  131.       }
  132.       var objTF = new TextFormat();
  133.       objTF.font = "Verdana";
  134.       objTF.size = 11;
  135.       objTF.color = "0x000000";
  136.       var i = 0;
  137.       while(i < arrData.length)
  138.       {
  139.          if(i % 2 == 1)
  140.          {
  141.             if(arrData[i] != "")
  142.             {
  143.                var _loc2_ = _loc1_.fib.attachMovie(_loc1_.c_strAthMC,"Box" + _loc1_.btnNo,i);
  144.                _loc1_.c_arrQuesNos.push(arrData[i]);
  145.                _loc2_._x = iMC_X;
  146.                _loc2_._y = iMC_Y;
  147.                _loc1_.setFibRefY(iMC_Y);
  148.                _loc2_.answered = "no";
  149.                _loc2_.gotoAndStop("NORMAL");
  150.                _loc2_.over.gotoAndStop("BLANK");
  151.                if(_loc1_.c_strType == "Button" or _loc1_.c_strType == "MovieClip")
  152.                {
  153.                   var iBoxWith = _loc2_._width - 12;
  154.                }
  155.                else
  156.                {
  157.                   var iBoxWith = _loc2_._width;
  158.                }
  159.                iMC_X += iBoxWith;
  160.                iMC_Width += iBoxWith;
  161.                if(iMC_X > _loc1_.iWidth)
  162.                {
  163.                   if(_loc1_.c_strType == "textField")
  164.                   {
  165.                      iMC_X = iBoxWith + 20;
  166.                   }
  167.                   else
  168.                   {
  169.                      iMC_X = iBoxWith + 10;
  170.                   }
  171.                   iMC_Width = iBoxWith;
  172.                   iMC_Y += _loc1_.iLineSp;
  173.                   if(_loc1_.c_strType == "textField")
  174.                   {
  175.                      _loc2_._x = 20;
  176.                   }
  177.                   else
  178.                   {
  179.                      _loc2_._x = 10;
  180.                   }
  181.                   _loc2_._y = iMC_Y;
  182.                }
  183.                if(_loc1_.c_strType == "Button")
  184.                {
  185.                   var strLable = arrData[i];
  186.                   _loc1_.setButtonEvents(_loc2_,strLable);
  187.                }
  188.                else if(_loc1_.c_strType == "MovieClip")
  189.                {
  190.                   _loc2_.btnLable.text = _loc1_.c_iExtID;
  191.                   _loc2_.strCorrectAnswer = arrData[i];
  192.                   _loc2_.ID = _loc1_.c_iExtID;
  193.                   _loc2_.inputTxt = "";
  194.                   _loc1_.c_iExtID = _loc1_.c_iExtID + 1;
  195.                   _loc1_.setMovieClipEvent(_loc2_);
  196.                   _loc1_.displayPreMode(_loc2_);
  197.                }
  198.                _loc1_.btnNo = _loc1_.btnNo + 1;
  199.             }
  200.          }
  201.          else if(i % 2 == 0)
  202.          {
  203.             var arrTmp = arrData[i].split(" ");
  204.             var tmpWidth = iMC_Width;
  205.             var strNewLine = false;
  206.             _loc1_.fib.createTextField("text" + i,i,iMC_X,iMC_Y,10,20);
  207.             var _loc3_ = _loc1_.fib["text" + i];
  208.             _loc3_.text = "";
  209.             var objOutput = _loc1_.populateText(arrTmp,_loc3_,objTF,iMC_Width,tmpWidth,strNewLine);
  210.             strNewLine = objOutput.strNewLine;
  211.             var j = objOutput.j;
  212.             iMC_Width = objOutput.iMC_Width;
  213.             _loc3_.text = _loc3_.text.substr(0,_loc3_.text.length - 1);
  214.             _loc3_.autoSize = true;
  215.             var strTmp = "";
  216.             arrData = _loc1_.updateTextField(j,arrTmp,strTmp,strNewLine,_loc3_,arrData,i);
  217.             if(_loc1_.c_strEnvironment == "Linux")
  218.             {
  219.                _loc3_.embedFonts = true;
  220.             }
  221.             delete j;
  222.             _loc3_._width = 10;
  223.             _loc3_.html = true;
  224.             _loc3_.htmlText = _loc3_.text;
  225.             _loc3_.autoSize = true;
  226.             _loc3_.setTextFormat(objTF);
  227.             iMC_X += _loc3_._width;
  228.             if(iMC_Width > _loc1_.iWidth or strNewLine)
  229.             {
  230.                if(_loc1_.c_strType == "textField")
  231.                {
  232.                   iMC_X = 20;
  233.                }
  234.                else
  235.                {
  236.                   iMC_X = 10;
  237.                }
  238.                iMC_Width = 0;
  239.                iMC_Y += _loc1_.iLineSp;
  240.             }
  241.          }
  242.          i++;
  243.       }
  244.       _loc1_.objRef.mc_ScrollPane.refreshPane();
  245.       _loc1_.objRef.mc_ScrollPane.setSize(_loc1_.objRef.mc_scrollRefrence._width - 1,_loc1_.objRef.mc_scrollRefrence._height - 1.2);
  246.       _loc1_.objRef.mc_ScrollPane._x = _loc1_.objRef.mc_scrollRefrence._x;
  247.       _loc1_.objRef.mc_ScrollPane._y = _loc1_.objRef.mc_scrollRefrence._y + 1.1;
  248.       delete objTF;
  249.    }
  250.    function updateTextField(in_j, arrTmp, strTmp, strNewLine, tField, arrData, in_iIndex, strEnvironment)
  251.    {
  252.       var _loc1_ = in_j;
  253.       var _loc2_ = strTmp;
  254.       var _loc3_ = arrTmp;
  255.       _loc1_;
  256.       while(_loc1_ < _loc3_.length)
  257.       {
  258.          _loc2_ = _loc2_ + _loc3_[_loc1_] + " ";
  259.          _loc1_ = _loc1_ + 1;
  260.       }
  261.       _loc2_ = _loc2_.substr(0,_loc2_.length - 1);
  262.       if(_loc2_.length > 0)
  263.       {
  264.          if(this.c_strEnvironment == "Linux")
  265.          {
  266.             tField.embedFonts = true;
  267.          }
  268.          if(!strNewLine)
  269.          {
  270.             tField.text = tField.text.substr(0,tField.text.length - _loc2_.split(" ")[0].length);
  271.          }
  272.          else
  273.          {
  274.             tField.text = tField.text.substr(0,tField.text.length - 2);
  275.          }
  276.          arrData = this.updateArray(arrData,_loc2_,in_iIndex);
  277.       }
  278.       return arrData;
  279.    }
  280.    function populateText(arrTmp, tField, objTF, iMC_Width, tmpWidth, strNewLine)
  281.    {
  282.       var _loc1_ = tField;
  283.       var _loc3_ = arrTmp;
  284.       var objOutput = new Object();
  285.       var _loc2_ = 0;
  286.       while(_loc2_ < _loc3_.length)
  287.       {
  288.          if(this.c_strEnvironment == "Linux")
  289.          {
  290.             _loc1_.embedFonts = true;
  291.          }
  292.          _loc1_.text = _loc1_.text + _loc3_[_loc2_] + " ";
  293.          _loc1_.type = "dynamic";
  294.          _loc1_.selectable = false;
  295.          _loc1_.setTextFormat(objTF);
  296.          _loc1_.autoSize = true;
  297.          _loc1_.multiline = true;
  298.          iMC_Width = tmpWidth + _loc1_._width;
  299.          if(iMC_Width > this.iWidth)
  300.          {
  301.             break;
  302.          }
  303.          if(_loc3_[_loc2_] == "<p></p>")
  304.          {
  305.             _loc2_ = _loc2_ + 1;
  306.             strNewLine = true;
  307.             break;
  308.          }
  309.          _loc2_ = _loc2_ + 1;
  310.       }
  311.       objOutput.j = _loc2_;
  312.       objOutput.strNewLine = strNewLine;
  313.       objOutput.iMC_Width = iMC_Width;
  314.       return objOutput;
  315.    }
  316.    function displayPreMode(box)
  317.    {
  318.       var _loc1_ = this;
  319.       var _loc2_ = box;
  320.       if(_loc1_.c_strMode == "Review")
  321.       {
  322.          _loc1_.objRef.btn_next._visible = true;
  323.          var strAnswered = _loc1_.c_objHMObj["get"](_loc1_.c_strSkill + "_" + _loc2_.ID).attempted;
  324.          if(strAnswered != null or strAnswered != undefined)
  325.          {
  326.             _loc2_.inputTxt = _loc1_.c_objHMObj["get"](_loc1_.c_strSkill + "_" + _loc2_.ID).attempted;
  327.          }
  328.          else
  329.          {
  330.             _loc2_.inputTxt = "";
  331.          }
  332.          var mcCorInc = _loc2_.attachMovie("mc_TickCross","mc_TickCross",10);
  333.          if(_loc1_.c_objHMObj["get"](_loc1_.c_strSkill + "_" + _loc2_.ID).correct == "1")
  334.          {
  335.             mcCorInc.gotoAndStop("CORRECT");
  336.          }
  337.          else
  338.          {
  339.             mcCorInc.gotoAndStop("INCORRECT");
  340.             var _loc3_ = _loc2_.attachMovie("mc_showbtn","mc_showbtn",11);
  341.             _loc3_.gotoAndStop("NORMAL");
  342.             _loc3_._x = 510 - _loc2_._x;
  343.          }
  344.          mcCorInc._x = 480 - _loc2_._x;
  345.          _loc3_.objRef = _loc1_;
  346.          _loc3_.onRelease = function()
  347.          {
  348.             var _loc1_ = this;
  349.             _loc1_.objRef.c_objNavRef.c_iSeleID = _loc1_._parent.ID;
  350.             _loc1_.objRef.c_objNavRef.c_preSelecetd = _loc1_.objRef.c_objNavRef.c_strSelecetd;
  351.             _loc1_.objRef.c_objNavRef.c_strSelecetd = "_" + _loc1_.objRef.c_iGroup + "_" + _loc1_._parent._name.split("Box")[1];
  352.             _loc1_.objRef.c_objNavRef.navClicked();
  353.             _loc1_.objRef.c_btnShowPrevious = _loc1_.objRef.c_btnShowCurrent;
  354.             _loc1_.objRef.c_btnShowPrevious.gotoAndStop("CLICKED");
  355.             _loc1_.objRef.c_btnShowCurrent.gotoAndStop("CLICKED");
  356.             _loc1_.objRef.c_btnShowCurrent = _loc1_;
  357.             _loc1_.objRef.showCurrectAnswer(_loc1_._parent.strCorrectAnswer,_loc1_._parent.ID,true);
  358.             _loc1_.gotoAndStop("CLICKED");
  359.          };
  360.       }
  361.       else if(_loc1_.c_strMode == "Continue")
  362.       {
  363.          var strAnswered = _loc1_.c_objHMObj["get"](_loc1_.c_strSkill + "_" + _loc2_.ID).attempted;
  364.          if(strAnswered != null or strAnswered != undefined)
  365.          {
  366.             _loc2_.inputTxt = _loc1_.c_objHMObj["get"](_loc1_.c_strSkill + "_" + _loc2_.ID).attempted;
  367.          }
  368.          else
  369.          {
  370.             _loc2_.inputTxt = "";
  371.          }
  372.       }
  373.    }
  374.    function setMovieClipEvent(box)
  375.    {
  376.       var _loc1_ = this;
  377.       var _loc2_ = box;
  378.       _loc2_.mc_Btn.onRollOver = function()
  379.       {
  380.          this._parent.mcOver.gotoAndStop("OVER");
  381.       };
  382.       _loc2_.mc_Btn.onRollOut = function()
  383.       {
  384.          this._parent.mcOver.gotoAndStop("BLANK");
  385.       };
  386.       _loc2_.mc_Btn.onDragOver = function()
  387.       {
  388.          this._parent.mcOver.gotoAndStop("OVER");
  389.       };
  390.       _loc2_.mc_Btn.onDragOut = function()
  391.       {
  392.          this._parent.mcOver.gotoAndStop("BLANK");
  393.       };
  394.       _loc2_.mc_Btn.objRef = _loc1_;
  395.       _loc2_.mc_Btn.onRelease = function()
  396.       {
  397.          var _loc1_ = this;
  398.          _loc1_.objRef.fileNo = _loc1_._parent._name.substr(3,_loc1_._name.length);
  399.          _loc1_.objRef.c_objNavRef.c_iSeleID = _loc1_._parent.ID;
  400.          _loc1_.objRef.c_objNavRef.c_preSelecetd = _loc1_.objRef.c_objNavRef.c_strSelecetd;
  401.          _loc1_.objRef.c_objNavRef.c_strSelecetd = "_" + _loc1_.objRef.c_iGroup + "_" + _loc1_.objRef.fileNo;
  402.          _loc1_.objRef.c_objNavRef.navClicked();
  403.          if(_loc1_.objRef.c_strMode != "Review")
  404.          {
  405.             trace(">>> Roleasee EVt - 1");
  406.             _loc1_.objRef.movclpClicked();
  407.          }
  408.          else
  409.          {
  410.             _loc1_.objRef.c_btnShowPrevious = _loc1_.objRef.c_btnShowCurrent;
  411.             _loc1_.objRef.c_btnShowCurrent = _loc1_._parent.mc_showbtn;
  412.             _loc1_.objRef.showCurrectAnswer(_loc1_._parent.strCorrectAnswer,_loc1_._parent.ID,false);
  413.          }
  414.       };
  415.    }
  416.    function setButtonEvents(box, strLable)
  417.    {
  418.       var _loc1_ = this;
  419.       var _loc2_ = box;
  420.       _loc2_.objRef = _loc1_;
  421.       _loc2_.btnLable.text = strLable;
  422.       _loc2_.onRollOver = function()
  423.       {
  424.          this.mcOver.gotoAndStop("OVER");
  425.       };
  426.       _loc2_.onRollOut = function()
  427.       {
  428.          this.mcOver.gotoAndStop("BLANK");
  429.       };
  430.       _loc2_.onDragOver = function()
  431.       {
  432.          this.mcOver.gotoAndStop("OVER");
  433.       };
  434.       _loc2_.onDragOut = function()
  435.       {
  436.          this.mcOver.gotoAndStop("BLANK");
  437.       };
  438.       _loc2_.onRelease = function()
  439.       {
  440.          var _loc1_ = this;
  441.          _loc1_.objRef.fileNo = _loc1_._name.substr(3,_loc1_._name.length);
  442.          _loc1_.objRef.c_objNavRef.c_iSeleID = _loc1_.objRef.c_arrQuesNos[_loc1_.objRef.fileNo];
  443.          _loc1_.objRef.c_objNavRef.c_preSelecetd = _loc1_.objRef.c_objNavRef.c_strSelecetd;
  444.          _loc1_.objRef.c_objNavRef.c_strSelecetd = "_" + (_loc1_.objRef.c_iGroup - 1) + "_" + _loc1_.objRef.fileNo;
  445.          _loc1_.objRef.c_objNavRef.navClicked();
  446.          _loc1_.objRef.btnClicked();
  447.       };
  448.    }
  449.    function showCurrectAnswer(_strAnswer, _Qno, _bln)
  450.    {
  451.       var _loc2_ = this;
  452.       _loc2_.c_btnShowPrevious.gotoAndStop("NORMAL");
  453.       var _loc1_ = _loc2_.objRef.mc_feedbackBox;
  454.       if(_bln)
  455.       {
  456.          _loc1_._visible = true;
  457.          _loc1_.btn_close.enabled = true;
  458.          _loc1_.btn_close.objRef = _loc2_;
  459.          _loc1_.btn_close.onRelease = function()
  460.          {
  461.             var _loc1_ = this;
  462.             _loc1_.objRef.c_btnShowCurrent.gotoAndStop("NORMAL");
  463.             _loc1_.objRef.c_btnShowCurrent.enabled = true;
  464.             _loc1_.enabled = false;
  465.             _loc1_._parent._visible = false;
  466.             _loc1_._parent.txt_header.text = "";
  467.             _loc1_._parent.txt_options.text = "";
  468.          };
  469.          _loc1_.swapDepths(100);
  470.          _loc1_.mc_resizableBox.useHandCursor = false;
  471.          _loc1_.mc_resizableBox.onPress = function()
  472.          {
  473.             this._parent.startDrag(false,-55,12,324,255);
  474.          };
  475.          _loc1_.mc_resizableBox.onRelease = _loc1_.mc_resizableBox.onReleaseOutside = function()
  476.          {
  477.             stopDrag();
  478.          };
  479.          var _loc3_ = new com.comp.ResizableBox();
  480.          _loc3_.resizeBox(370,80,_loc1_.mc_resizableBox);
  481.          var revTxt = _loc2_.objRef.mc_resizableBox;
  482.          _loc1_.txt_header.text = "Correct Answer(s) for Question No. " + _Qno;
  483.          _loc1_.txt_header.autoSize = "left";
  484.          _loc1_.txt_options.text = _strAnswer.split("|").join(", ");
  485.          _loc1_.txt_options.autoSize = "left";
  486.       }
  487.       else
  488.       {
  489.          _loc1_._visible = false;
  490.       }
  491.    }
  492.    function arrangetext()
  493.    {
  494.       this.strText = this.strText.split("<p></p>").join(" <p></p> ");
  495.       var _loc3_ = this.strText.split("<gap>");
  496.       var arrData = new Array();
  497.       arrData.push(_loc3_[0]);
  498.       var _loc1_ = 1;
  499.       while(_loc1_ < _loc3_.length)
  500.       {
  501.          var _loc2_ = _loc3_[_loc1_].split("</gap>");
  502.          arrData.push(_loc2_[0]);
  503.          arrData.push(_loc2_[1]);
  504.          false;
  505.          _loc1_ = _loc1_ + 1;
  506.       }
  507.       false;
  508.       false;
  509.       return arrData;
  510.    }
  511.    function updateArray(_arr, _str, _iPos)
  512.    {
  513.       var _loc2_ = _arr;
  514.       var _loc3_ = new Array();
  515.       var _loc1_ = undefined;
  516.       _loc1_ = 0;
  517.       while(_loc1_ < _iPos + 1)
  518.       {
  519.          _loc3_.push(_loc2_[_loc1_]);
  520.          _loc1_ = _loc1_ + 1;
  521.       }
  522.       _loc3_.push("");
  523.       _loc3_.push(_str);
  524.       _loc1_;
  525.       while(_loc1_ < _loc2_.length)
  526.       {
  527.          _loc3_.push(_loc2_[_loc1_]);
  528.          _loc1_ = _loc1_ + 1;
  529.       }
  530.       false;
  531.       false;
  532.       delete _str;
  533.       delete _iPos;
  534.       return _loc3_;
  535.    }
  536.    function movclpClicked()
  537.    {
  538.       var _loc1_ = this;
  539.       var _loc2_ = 0;
  540.       while(_loc2_ < _loc1_.btnNo)
  541.       {
  542.          var box = _loc1_.fib["Box" + _loc2_];
  543.          if(box.inputTxt.length == 0)
  544.          {
  545.             box.gotoAndStop("NORMAL");
  546.          }
  547.          else
  548.          {
  549.             box.gotoAndStop("TYPED");
  550.             var _loc3_ = _loc1_.c_objNavRef.c_objTestRef.c_iPartNo;
  551.             var charCase = _loc1_.c_objNavRef.c_objTestRef.c_objScreenData.DOC.section[_loc3_].question[_loc2_].attributes.charToUpper;
  552.             if(charCase != "true")
  553.             {
  554.                var strText = box.btnLable.text;
  555.                trace(">>>># F35666 - strText : " + strText);
  556.                box.btnLable.text = String(strText).toLowerCase();
  557.             }
  558.             else
  559.             {
  560.                var strText = box.btnLable.text;
  561.                box.btnLable.text = String(strText);
  562.             }
  563.          }
  564.          box.mcOver.gotoAndStop("BLANK");
  565.          box.mc_Btn.enabled = true;
  566.          Key.removeListener(box.objkeyUP);
  567.          delete box.objkeyUP;
  568.          delete box;
  569.          _loc2_ = _loc2_ + 1;
  570.       }
  571.       var box = _loc1_.fib["Box" + _loc1_.fileNo];
  572.       box.objkeyUP = new Object();
  573.       box.objkeyUP.objRef = _loc1_;
  574.       box.objkeyUP.onKeyUp = function()
  575.       {
  576.          this.objRef.textFieldChanged();
  577.       };
  578.       Key.addListener(box.objkeyUP);
  579.       _loc1_.objRef.obj = _loc1_;
  580.       _loc1_.objRef.objKeyup = box.objkeyUP;
  581.       _loc1_.objRef.onUnload = function()
  582.       {
  583.          this.obj.removedMovieObject();
  584.          Key.removeListener(this.objKeyup);
  585.       };
  586.       box.gotoAndStop("CLICKED");
  587.       box.mcOver.gotoAndStop("BLANK");
  588.       box.mc_Btn.enabled = false;
  589.       _loc2_ = 0;
  590.       while(_loc2_ < _loc1_.c_arrQuesNos.length)
  591.       {
  592.          _loc1_.objRef.btn_next._visible = true;
  593.          if(_loc1_.objRef.fib["Box" + _loc2_].inputTxt.length < 1)
  594.          {
  595.             _loc1_.objRef.btn_next._visible = false;
  596.             break;
  597.          }
  598.          _loc2_ = _loc2_ + 1;
  599.       }
  600.    }
  601.    function textFieldChanged()
  602.    {
  603.       var _loc1_ = this;
  604.       if(_loc1_.c_objNavRef.c_objTestRef.c_objScreenData.DOC.section.length - 1 != _loc1_.c_objNavRef.c_objTestRef.c_iPartNo && _loc1_.c_strSkill.toLowerCase != "reading")
  605.       {
  606.          var _loc2_ = 0;
  607.          while(_loc2_ < _loc1_.c_arrQuesNos.length)
  608.          {
  609.             _loc1_.objRef.btn_next._visible = true;
  610.             if(_loc1_.objRef.fib["Box" + _loc2_].inputTxt.length < 1)
  611.             {
  612.                _loc1_.objRef.btn_next._visible = false;
  613.                break;
  614.             }
  615.             _loc2_ = _loc2_ + 1;
  616.          }
  617.       }
  618.       var _loc3_ = new Object();
  619.       if(_loc1_.objRef.fib["Box" + _loc1_.fileNo].inputTxt.length > 0)
  620.       {
  621.          var _strCorrAns = _loc1_.objRef.fib["Box" + _loc1_.fileNo].strCorrectAnswer;
  622.          var testRef_pno = _loc1_.c_objNavRef.c_objTestRef.c_iPartNo;
  623.          _loc1_.c_upperChk = _loc1_.c_objNavRef.c_objTestRef.c_objScreenData.DOC.section[testRef_pno].question[_loc1_.fileNo].attributes.charToUpper;
  624.          if(_loc1_.c_upperChk == "true")
  625.          {
  626.             var strQuestionText = _loc1_.objRef.fib["Box" + _loc1_.fileNo].inputTxt;
  627.          }
  628.          else
  629.          {
  630.             var strQuestionText = _loc1_.objRef.fib["Box" + _loc1_.fileNo].inputTxt.toLowerCase();
  631.          }
  632.          _loc3_.attempted = strQuestionText;
  633.          var arrCorrAns = _strCorrAns.split("|");
  634.          _loc2_ = 0;
  635.          while(_loc2_ < arrCorrAns.length)
  636.          {
  637.             if(strQuestionText == arrCorrAns[_loc2_])
  638.             {
  639.                _loc3_.correct = 1;
  640.                break;
  641.             }
  642.             _loc3_.correct = 0;
  643.             _loc2_ = _loc2_ + 1;
  644.          }
  645.          _loc1_.c_objNavRef.markAttempted();
  646.          _loc1_.c_objNavRef.c_objTestRef.appendQuesObject(_loc3_);
  647.       }
  648.       else
  649.       {
  650.          _loc3_.correct = undefined;
  651.          _loc3_.attempted = undefined;
  652.          _loc1_.c_objNavRef.markUnAttempted();
  653.          _loc1_.c_objNavRef.c_objTestRef.removeQuesObject();
  654.       }
  655.    }
  656.    function movclpNavClicked()
  657.    {
  658.       var _loc1_ = this;
  659.       var _loc2_ = 0;
  660.       while(_loc2_ < _loc1_.btnNo)
  661.       {
  662.          var box = _loc1_.fib["Box" + _loc2_];
  663.          if(box.inputTxt.length == 0)
  664.          {
  665.             box.gotoAndStop("NORMAL");
  666.          }
  667.          else
  668.          {
  669.             box.gotoAndStop("TYPED");
  670.             var _loc3_ = _loc1_.c_objNavRef.c_objTestRef.c_iPartNo;
  671.             var charCase = _loc1_.c_objNavRef.c_objTestRef.c_objScreenData.DOC.section[_loc3_].question[_loc2_].attributes.charToUpper;
  672.             if(charCase != "true")
  673.             {
  674.                var strText = box.btnLable.text;
  675.                box.btnLable.text = String(strText).toLowerCase();
  676.             }
  677.             else
  678.             {
  679.                var strText = box.btnLable.text;
  680.                box.btnLable.text = String(strText);
  681.             }
  682.          }
  683.          box.mcOver.gotoAndStop("BLANK");
  684.          if(_loc1_.c_strMode != "Review")
  685.          {
  686.             box.mc_Btn.enabled = true;
  687.          }
  688.          Key.removeListener(box.objkeyUP);
  689.          delete box.objkeyUP;
  690.          delete box;
  691.          _loc2_ = _loc2_ + 1;
  692.       }
  693.       var box = _loc1_.fib["Box" + _loc1_.fileNo];
  694.       if(box.inputTxt.length == 0)
  695.       {
  696.          box.gotoAndStop("NAVCLICKEDNA");
  697.       }
  698.       else
  699.       {
  700.          box.gotoAndStop("NAVCLICKEDA");
  701.       }
  702.       _loc2_ = 0;
  703.       while(_loc2_ < _loc1_.c_arrQuesNos.length)
  704.       {
  705.          _loc1_.objRef.btn_next._visible = true;
  706.          if(_loc1_.objRef.fib["Box" + _loc2_].inputTxt.length < 1)
  707.          {
  708.             _loc1_.objRef.btn_next._visible = false;
  709.             break;
  710.          }
  711.          _loc2_ = _loc2_ + 1;
  712.       }
  713.       if(_loc1_.c_strMode == "Review")
  714.       {
  715.          _loc1_.objRef.btn_next._visible = true;
  716.          _loc1_.c_btnShowPrevious = _loc1_.c_btnShowCurrent;
  717.          _loc1_.c_btnShowCurrent = box.mc_showbtn;
  718.          _loc1_.showCurrectAnswer(box.strCorrectAnswer,box.ID,false);
  719.       }
  720.    }
  721.    function getWidth()
  722.    {
  723.       return this.fib._width;
  724.    }
  725.    function getHeight()
  726.    {
  727.       return this.fib._height;
  728.    }
  729.    function setFibRefY(fib_ypos)
  730.    {
  731.       this.c_fibY = fib_ypos;
  732.    }
  733.    function getFibRefY()
  734.    {
  735.       return this.c_fibY;
  736.    }
  737.    function btnClicked()
  738.    {
  739.       var _loc1_ = this;
  740.       var _loc3_ = 0;
  741.       while(_loc3_ < _loc1_.btnNo)
  742.       {
  743.          var _loc2_ = _loc1_.fib["Box" + _loc3_];
  744.          if(_loc2_.answered != "yes")
  745.          {
  746.             _loc2_.gotoAndStop("NORMAL");
  747.          }
  748.          else
  749.          {
  750.             _loc2_.gotoAndStop("TYPED");
  751.          }
  752.          if(_loc1_.c_strType == "Button")
  753.          {
  754.             if(_loc1_.c_strMode == "Continue" || _loc1_.c_strMode == "Review")
  755.             {
  756.                var strAnswered = _loc1_.c_objHMObj["get"](_loc1_.c_strSkill + "_" + (_loc3_ + 1)).attempted;
  757.                if(strAnswered != null or strAnswered != undefined)
  758.                {
  759.                   _loc2_.gotoAndStop("TYPED");
  760.                   _loc2_.btnLable.text = _loc1_.c_objNavRef.c_objTestRef.c_objScreenData.DOC.section[_loc1_.c_objNavRef.c_objTestRef.c_iPartNo].question[_loc3_].choice[strAnswered - 1].data;
  761.                }
  762.             }
  763.          }
  764.          _loc2_.mcOver.gotoAndStop("BLANK");
  765.          _loc2_.enabled = true;
  766.          _loc3_ = _loc3_ + 1;
  767.       }
  768.       _loc1_.fib["Box" + _loc1_.fileNo].gotoAndStop("CLICKED");
  769.       _loc1_.fib["Box" + _loc1_.fileNo].enabled = false;
  770.    }
  771.    function navBtnClicked(_iCurrQuestion)
  772.    {
  773.       var _loc1_ = this;
  774.       var _loc2_ = _iCurrQuestion;
  775.       if(_loc1_.c_strType == "Button")
  776.       {
  777.          _loc1_.fileNo = _loc2_;
  778.          _loc1_.btnClicked();
  779.       }
  780.       else if(_loc1_.c_strType == "MovieClip")
  781.       {
  782.          _loc1_.fileNo = _loc2_;
  783.          _loc1_.movclpNavClicked();
  784.       }
  785.       _loc1_.setScrollBarPosition(_loc2_);
  786.    }
  787.    function setScrollBarPosition(_iCurrQuestion)
  788.    {
  789.       var _loc2_ = this.fib["Box" + _iCurrQuestion];
  790.       var boxTargetX = _loc2_._x;
  791.       var _loc1_ = _loc2_._y;
  792.       if(_iCurrQuestion == 0)
  793.       {
  794.          _loc1_ = 0;
  795.       }
  796.       else
  797.       {
  798.          _loc1_ -= 100;
  799.       }
  800.       this.objRef.mc_ScrollPane.setScrollPosition(0,_loc1_);
  801.    }
  802.    function updateText(str)
  803.    {
  804.       var _loc1_ = this;
  805.       _loc1_.fib["Box" + _loc1_.fileNo].btnLable.text = str;
  806.       _loc1_.fib["Box" + _loc1_.fileNo].answered = "yes";
  807.    }
  808.    function getNumberOfBox()
  809.    {
  810.       var _loc3_ = this;
  811.       var arrNumberFIB = new Array();
  812.       var _loc1_ = 0;
  813.       while(_loc1_ < _loc3_.btnNo)
  814.       {
  815.          var _loc2_ = _loc3_.fib["Box" + _loc1_];
  816.          arrNumberFIB.push(_loc2_);
  817.          _loc1_ = _loc1_ + 1;
  818.       }
  819.       return arrNumberFIB;
  820.    }
  821.    function freeze(_blnFreeze)
  822.    {
  823.    }
  824. }
  825.