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

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