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

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