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

  1. class com.screen.Instruction
  2. {
  3.    function Instruction()
  4.    {
  5.    }
  6.    function init(_objScreenData, _objSourceRef)
  7.    {
  8.       var _loc1_ = this;
  9.       _level101.attachMovie("mc_Instruct","mc_Instruction",650,{_x:172,_y:111});
  10.       _loc1_.c_objSourceClipRef = _level101.mc_Instruction.mc_text;
  11.       _loc1_.c_objScreenData = _objScreenData;
  12.       _loc1_.c_objSourceRef = _objSourceRef;
  13.       com.controller.UICoordinator.getInstance().instructionXML = _objScreenData;
  14.       _loc1_.loadScreen();
  15.    }
  16.    function loadScreen()
  17.    {
  18.       var _loc1_ = 778;
  19.       _level101.gotoAndStop("INSTRUCTION");
  20.       _level101.txt_ApplicationHeader1.autoSize = true;
  21.       _level101.txt_ApplicationHeader1.html = true;
  22.       _level101.txt_ApplicationHeader1.htmlText = com.controller.UICoordinator.getInstance().getTitle();
  23.       _level101.txt_ApplicationHeader1._x = (_loc1_ - _level101.txt_ApplicationHeader1.textWidth) / 2;
  24.       if(com.controller.UICoordinator.getInstance().skillName == "reading")
  25.       {
  26.          _level101.txt_Heading.text = "TEST " + com.controller.UICoordinator.getInstance().c_iCurrentTestNumber + ": READING";
  27.       }
  28.       else if(com.controller.UICoordinator.getInstance().skillName == "writing")
  29.       {
  30.          _level101.txt_Heading.text = "TEST " + com.controller.UICoordinator.getInstance().c_iCurrentTestNumber + ": WRITING";
  31.       }
  32.       else if(com.controller.UICoordinator.getInstance().skillName == "listening")
  33.       {
  34.          _level101.txt_Heading.text = "TEST " + com.controller.UICoordinator.getInstance().c_iCurrentTestNumber + ": LISTENING";
  35.       }
  36.       else if(com.controller.UICoordinator.getInstance().skillName == "useofenglish")
  37.       {
  38.          _level101.txt_Heading.text = "TEST " + com.controller.UICoordinator.getInstance().c_iCurrentTestNumber + ": USE OF ENGLISH";
  39.       }
  40.       this.arrange(this);
  41.    }
  42.    function arrange(_objRef)
  43.    {
  44.       var _loc1_ = _objRef;
  45.       var _loc3_ = this;
  46.       var objLogin = _loc1_.c_objScreenData.login;
  47.       var _loc2_ = com.controller.UICoordinator.getInstance().skillName;
  48.       if(_loc2_ == "reading")
  49.       {
  50.          _loc3_.c_objSourceClipRef.txt_inst.htmlText = _loc1_.c_objScreenData.instructions.instructionsreading.data;
  51.       }
  52.       else if(_loc2_ == "writing")
  53.       {
  54.          _loc3_.c_objSourceClipRef.txt_inst.htmlText = _loc1_.c_objScreenData.instructions.instructionswriting.data;
  55.       }
  56.       else if(_loc2_ == "listening")
  57.       {
  58.          _loc3_.c_objSourceClipRef.txt_inst.htmlText = _loc1_.c_objScreenData.instructions.instructionslistening.data;
  59.       }
  60.       else if(_loc2_ == "useofenglish")
  61.       {
  62.          _loc3_.c_objSourceClipRef.txt_inst.htmlText = _loc1_.c_objScreenData.instructions.instructionsuseofenglish.data;
  63.       }
  64.       _level101.mc_Instruction.txt_instguide.htmlText = _loc1_.c_objScreenData.instructions.instructionsguide.data;
  65.       _loc3_.setEvents();
  66.    }
  67.    function setEvents()
  68.    {
  69.       var _loc1_ = this;
  70.       _level101.mc_Instruction.btn_startTest.objRef = _loc1_;
  71.       _level101.mc_Instruction.btn_startTest.onRelease = function()
  72.       {
  73.          this.enabled = false;
  74.          _level101.soundBtn._visible = true;
  75.          _level101.volumeBox._visible = true;
  76.          _level101.soundLevel._visible = true;
  77.          var _loc1_ = _level101.c_objSourceClipRef.mc_text.text.text;
  78.          this.objRef.notifySource(_loc1_);
  79.          _level101.mc_Instruction.removeMovieClip();
  80.       };
  81.    }
  82.    function notifySource(_strLoginData)
  83.    {
  84.       var _loc1_ = com.controller.UICoordinator.getInstance().currentMode;
  85.       if(_loc1_ == "Continue" || _loc1_ == "Review")
  86.       {
  87.          this.c_objSourceRef.onProcessComplete("ReviewResult","");
  88.       }
  89.       else
  90.       {
  91.          this.c_objSourceRef.onProcessComplete("LOADTEST",_strLoginData);
  92.       }
  93.    }
  94. }
  95.