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

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