home *** CD-ROM | disk | FTP | other *** search
/ T-Online 6 / T-Online.iso / Animation / content / intro / intro.swf / scripts / __Packages / application / screens / HeadlineScreen.as < prev    next >
Encoding:
Text File  |  2005-10-20  |  4.8 KB  |  181 lines

  1. class application.screens.HeadlineScreen extends application.screens.AbstractScreen implements application.models.IScreen
  2. {
  3.    var data;
  4.    var state;
  5.    var format;
  6.    var isSpecial;
  7.    var activeMain;
  8.    var activeSub;
  9.    var dataObj;
  10.    var tf;
  11.    var configObj;
  12.    var rootMC;
  13.    function HeadlineScreen()
  14.    {
  15.       super();
  16.       this.data = null;
  17.       this.state = null;
  18.       this.format = new TextFormat();
  19.       this.format.align = "left";
  20.       this.format.color = 14811252;
  21.       this.format.font = "Tele-Antiqua";
  22.       this.format.leading = 2;
  23.       this.format.size = 32;
  24.    }
  25.    function setAciveContent(activeMain, activeSub)
  26.    {
  27.       this.isSpecial = false;
  28.       this.activeMain = activeMain;
  29.       this.activeSub = activeSub;
  30.       if(activeMain <= 3)
  31.       {
  32.          this.data = this.dataObj.content[activeMain];
  33.          this.state = 2;
  34.       }
  35.       else if(activeMain == 4)
  36.       {
  37.          this.data = this.dataObj.benefit;
  38.          this.state = 3;
  39.       }
  40.       else if(activeMain == 5)
  41.       {
  42.          this.data = this.dataObj.tonline;
  43.          this.state = 3;
  44.       }
  45.       else if(activeMain == 6)
  46.       {
  47.          this.data = this.dataObj.client;
  48.          this.state = 3;
  49.       }
  50.       else if(activeMain == 7)
  51.       {
  52.          this.data = this.dataObj.install;
  53.          this.state = 3;
  54.       }
  55.       else if(activeMain == 8)
  56.       {
  57.          this.data = this.dataObj.software;
  58.          this.state = 4;
  59.       }
  60.       else if(activeMain == 9)
  61.       {
  62.          this.data = this.dataObj.imprint;
  63.          this.state = 3;
  64.       }
  65.       else if(activeMain == 11)
  66.       {
  67.          this.data = this.dataObj.help;
  68.          this.state = 4;
  69.       }
  70.       this.hitArea.onDisable();
  71.    }
  72.    function showText(s)
  73.    {
  74.       this.tf.text = s;
  75.       this.tf.setTextFormat(this.format);
  76.       this.hitArea.clear();
  77.       this.hitArea.beginFill(100,0);
  78.       this.hitArea.moveTo(this.tf._x,this.tf._y + 6);
  79.       this.hitArea.lineTo(this.tf._x,this.tf._y + 6 + this.tf._height - 10);
  80.       this.hitArea.lineTo(this.tf._x + this.tf._width,this.tf._y + 6 + this.tf._height - 10);
  81.       this.hitArea.lineTo(this.tf._x + this.tf._width,this.tf._y + 6);
  82.       this.hitArea.lineTo(this.tf._x,this.tf._y + 6);
  83.       this.hitArea.endFill();
  84.       this.createFocusRec(this.hitArea,this.tf._width,this.tf._height - 10,this.tf._x,this.tf._y + 6);
  85.       if(s == this.configObj.textList.helpContent)
  86.       {
  87.          this.hitArea.onEnable();
  88.          this.isSpecial = true;
  89.       }
  90.       else
  91.       {
  92.          this.hitArea.onDisable();
  93.          this.isSpecial = false;
  94.       }
  95.    }
  96.    function update(activeSub)
  97.    {
  98.       var _loc2_ = null;
  99.       _loc2_ = this.data.contentList;
  100.       if(_loc2_[0].site != null)
  101.       {
  102.          if(activeSub != 0)
  103.          {
  104.             this.hitArea.onEnable();
  105.          }
  106.          else
  107.          {
  108.             this.hitArea.onDisable();
  109.          }
  110.       }
  111.       else if(activeSub >= 2)
  112.       {
  113.          this.hitArea.onEnable();
  114.       }
  115.       else
  116.       {
  117.          this.hitArea.onDisable();
  118.       }
  119.    }
  120.    function build()
  121.    {
  122.       this.hitArea = this.createEmptyMovieClip("hitArea",1);
  123.       this.createTextField("tf",2,20,10,500,30);
  124.       this.tf.autoSize = true;
  125.       this.tf.embedFonts = true;
  126.       this.tf.multiline = false;
  127.       this.tf.selectable = false;
  128.       this.tf.text = this.data.headline;
  129.       this.tf.setTextFormat(this.format);
  130.       this.hitArea.clear();
  131.       this.hitArea.beginFill(100,0);
  132.       this.hitArea.moveTo(this.tf._x,this.tf._y + 6);
  133.       this.hitArea.lineTo(this.tf._x,this.tf._y + 6 + this.tf._height - 14);
  134.       this.hitArea.lineTo(this.tf._x + this.tf._width,this.tf._y + 6 + this.tf._height - 14);
  135.       this.hitArea.lineTo(this.tf._x + this.tf._width,this.tf._y + 6);
  136.       this.hitArea.lineTo(this.tf._x,this.tf._y + 6);
  137.       this.hitArea.endFill();
  138.       this.buildButton(this.hitArea);
  139.       this.createFocusRec(this.hitArea,this.hitArea._width,this.hitArea._height,this.tf._x,this.tf._y + 6);
  140.       application.core.FocusManager.getInstance().registerButton(this.hitArea,8);
  141.    }
  142.    function onButtonRollOver(mc)
  143.    {
  144.    }
  145.    function onButtonRollOut(mc)
  146.    {
  147.    }
  148.    function onButtonPress(mc)
  149.    {
  150.    }
  151.    function onButtonRelease(mc)
  152.    {
  153.       if(!this.isSpecial)
  154.       {
  155.          var _loc2_ = null;
  156.          _loc2_ = this.data.contentList;
  157.          if(_loc2_[0].site != null)
  158.          {
  159.             this.rootMC.update(this.state,this.activeMain,0);
  160.          }
  161.          else
  162.          {
  163.             this.rootMC.update(this.state,this.activeMain,1);
  164.          }
  165.       }
  166.       else
  167.       {
  168.          this.rootMC.getNextContent();
  169.       }
  170.    }
  171.    function onButtonDisable(mc)
  172.    {
  173.    }
  174.    function onButtonEnable(mc)
  175.    {
  176.    }
  177.    function onButtonReleaseOutside(mc)
  178.    {
  179.    }
  180. }
  181.