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

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