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

  1. class application.contents.ClientContent extends MovieClip implements application.models.IContent
  2. {
  3.    var scrollBar;
  4.    var configObj;
  5.    var systemObj;
  6.    var dataObj;
  7.    var internalContent;
  8.    var loadingManager;
  9.    var externalContent;
  10.    var instCounter;
  11.    var nav;
  12.    var headline;
  13.    var registrationBlind;
  14.    var disclaimScroll;
  15.    var mask;
  16.    var rateScreen;
  17.    function ClientContent()
  18.    {
  19.       super();
  20.    }
  21.    function build(mc, dataObj, systemObj, configObj)
  22.    {
  23.       this.scrollBar = null;
  24.       this.configObj = configObj;
  25.       this.systemObj = systemObj;
  26.       this.dataObj = dataObj;
  27.       this.internalContent = mc;
  28.       var _loc2_ = application.core.ContentManager.getInstance();
  29.       var _loc7_ = _loc2_.getActiveMain();
  30.       var _loc5_ = _loc2_.getActiveSub();
  31.       var _loc3_ = _loc2_.getIface();
  32.       application.core.FocusManager.getInstance().reset();
  33.       application.core.FocusManager.getInstance().setContent(this);
  34.       _loc3_.coBrandHolder.coBrand.hide();
  35.       this.loadingManager = _loc2_.getLoadingManager();
  36.       this.externalContent = this.internalContent.createEmptyMovieClip("externalContent",this.instCounter);
  37.       this.instCounter = this.instCounter + 1;
  38.       var _loc4_ = dataObj.client.contentList[_loc5_].site;
  39.       var _loc6_ = this.externalContent;
  40.       this.loadingManager.addListener(this);
  41.       this.loadingManager.load(_loc4_,_loc6_,"onInitialLoad");
  42.    }
  43.    function remove()
  44.    {
  45.       this.nav.removeMovieClip();
  46.       this.headline.removeMovieClip();
  47.       this.registrationBlind.removeMovieClip();
  48.       this.externalContent.removeMovieClip();
  49.       this.scrollBar.removeMovieClip();
  50.    }
  51.    function update(state, activeMain, activeSub)
  52.    {
  53.       this.registrationBlind.hideBackButton();
  54.       this.disclaimScroll.removeMovieClip();
  55.       var _loc2_ = application.core.ContentManager.getInstance();
  56.       _loc2_.setActiveMain(activeMain);
  57.       _loc2_.setActiveSub(activeSub);
  58.       var _loc5_ = _loc2_.getIface();
  59.       var _loc3_ = this.dataObj.client.contentList[activeSub].site;
  60.       var _loc4_ = this.externalContent;
  61.       this.loadingManager.addListener(this);
  62.       this.loadingManager.load(_loc3_,_loc4_,"onLoad");
  63.    }
  64.    function getPreviousContent()
  65.    {
  66.       var _loc2_ = application.core.ContentManager.getInstance();
  67.       _loc2_.getPreviousContent();
  68.       var _loc4_ = _loc2_.getActiveMain();
  69.       var _loc5_ = _loc2_.getActiveSub();
  70.       if(_loc4_ != null)
  71.       {
  72.          var _loc3_ = this.dataObj.client.contentList[_loc5_].site;
  73.          var _loc6_ = this.externalContent;
  74.          this.loadingManager.addListener(this);
  75.          this.loadingManager.load(_loc3_,_loc6_,"onLoadPrevious");
  76.       }
  77.       else
  78.       {
  79.          this.remove();
  80.          _loc2_.showContent(2,null,null);
  81.       }
  82.    }
  83.    function getNextContent()
  84.    {
  85.       var _loc2_ = application.core.ContentManager.getInstance();
  86.       _loc2_.getNextContent();
  87.       var _loc4_ = _loc2_.getActiveMain();
  88.       var _loc5_ = _loc2_.getActiveSub();
  89.       if(_loc4_ != null)
  90.       {
  91.          var _loc3_ = this.dataObj.client.contentList[_loc5_].site;
  92.          var _loc6_ = this.externalContent;
  93.          this.loadingManager.addListener(this);
  94.          this.loadingManager.load(_loc3_,_loc6_,"onLoad");
  95.       }
  96.       else
  97.       {
  98.          this.remove();
  99.          _loc2_.showContent(2,null,null);
  100.       }
  101.    }
  102.    function onInitialLoad()
  103.    {
  104.       this.loadingManager.removeListener(this);
  105.       this.externalContent.gotoAndStop(1);
  106.       var _loc4_ = application.core.ContentManager.getInstance();
  107.       var _loc6_ = _loc4_.getActiveMain();
  108.       var _loc2_ = _loc4_.getActiveSub();
  109.       var _loc3_ = _loc4_.getIface();
  110.       Object.registerClass("dummy",application.screens.TreeSubNavigation);
  111.       this.nav = application.screens.TreeSubNavigation(this.internalContent.attachMovie("dummy","subnav",this.instCounter));
  112.       this.instCounter = this.instCounter + 1;
  113.       this.nav._x = int(_loc3_.contentHolder._x + 2);
  114.       this.nav._y = int(_loc3_.contentHolder._y + 3);
  115.       this.nav.setSystemProvider(this.systemObj);
  116.       this.nav.setConfigProvider(this.configObj);
  117.       this.nav.setDataObj(this.dataObj);
  118.       this.nav.setAciveContent(_loc6_,_loc2_);
  119.       this.nav.setContainer(this);
  120.       this.nav.build();
  121.       this.nav.update(_loc2_);
  122.       Object.registerClass("dummy",application.screens.HeadlineScreen);
  123.       this.headline = application.screens.HeadlineScreen(this.internalContent.attachMovie("dummy","headline" + this.instCounter,this.instCounter));
  124.       this.instCounter = this.instCounter + 1;
  125.       this.headline.setDataObj(this.dataObj);
  126.       this.headline.setConfigProvider(this.configObj);
  127.       this.headline.setAciveContent(_loc6_,_loc2_);
  128.       this.headline.setContainer(this);
  129.       this.headline.build();
  130.       this.headline.update(_loc2_);
  131.       Object.registerClass("registrationBlind",application.screens.RegistrationBlindScreen);
  132.       this.registrationBlind = application.screens.RegistrationBlindScreen(this.internalContent.attachMovie("registrationBlind","registrationBlind" + this.instCounter,this.instCounter));
  133.       this.instCounter = this.instCounter + 1;
  134.       this.registrationBlind.setSystemProvider(this.systemObj);
  135.       this.registrationBlind.setConfigProvider(this.configObj);
  136.       this.registrationBlind.setDataObj(this.dataObj);
  137.       this.registrationBlind._x = 192;
  138.       this.registrationBlind._y = 375 - this.registrationBlind._height;
  139.       this.registrationBlind.setContainer(this);
  140.       this.registrationBlind.build();
  141.       _loc3_.contentBackground.gotoAndStop(3);
  142.       var _loc5_ = 302 - this.registrationBlind._height;
  143.       var _loc7_ = this.registrationBlind._width - 17;
  144.       if(this.externalContent._height > _loc5_)
  145.       {
  146.          this.buildScrollbar(_loc7_,_loc5_);
  147.       }
  148.       else if(this.mask != null)
  149.       {
  150.          this.mask.removeMovieClip();
  151.          this.mask = null;
  152.          this.scrollBar.removeMovieClip();
  153.          this.scrollBar = null;
  154.       }
  155.    }
  156.    function onLoad()
  157.    {
  158.       this.loadingManager.removeListener(this);
  159.       this.externalContent.gotoAndStop(1);
  160.       this.externalContent._y = 0;
  161.       var _loc4_ = application.core.ContentManager.getInstance();
  162.       var _loc6_ = _loc4_.getActiveMain();
  163.       var _loc2_ = _loc4_.getActiveSub();
  164.       this.nav.update(_loc2_);
  165.       this.headline.update(_loc2_);
  166.       var _loc3_ = 302 - this.registrationBlind._height;
  167.       var _loc5_ = this.registrationBlind._width - 17;
  168.       if(this.externalContent._height > _loc3_)
  169.       {
  170.          this.buildScrollbar(_loc5_,_loc3_);
  171.       }
  172.       else
  173.       {
  174.          this.removeScrollbar();
  175.       }
  176.       if(this.dataObj.client.contentList[_loc2_].isRateScreen)
  177.       {
  178.          if(this.rateScreen != null)
  179.          {
  180.             this.rateScreen.removeMovieClip();
  181.          }
  182.          Object.registerClass("dummy",application.screens.RateScreen);
  183.          this.rateScreen = application.screens.RateScreen(this.internalContent.attachMovie("dummy","rateScreen" + this.instCounter,this.instCounter));
  184.          this.instCounter = this.instCounter + 1;
  185.          this.rateScreen._x = 193;
  186.          this.rateScreen._y = 73;
  187.          this.rateScreen.setActiveSub(_loc2_);
  188.          this.rateScreen.setDataObj(this.dataObj);
  189.          this.rateScreen.setContentMC(this.externalContent);
  190.          this.registrationBlind.setRateScreen(this.rateScreen);
  191.          this.rateScreen.setContainer(this);
  192.          this.rateScreen.build();
  193.          this.removeScrollbar();
  194.       }
  195.       else if(this.rateScreen != null)
  196.       {
  197.          this.rateScreen.removeMovieClip();
  198.          this.rateScreen = null;
  199.       }
  200.    }
  201.    function onChangeRateContent(isSubcontent)
  202.    {
  203.       if(isSubcontent == true)
  204.       {
  205.          this.disclaimScroll.removeMovieClip();
  206.          this.rateScreen.disable();
  207.          this.registrationBlind.showBackButton();
  208.       }
  209.       else
  210.       {
  211.          this.rateScreen.enable();
  212.          this.registrationBlind.hideBackButton();
  213.       }
  214.       var _loc2_ = 302 - this.registrationBlind._height;
  215.       var _loc3_ = this.registrationBlind._width - 17;
  216.       if(this.externalContent._height > _loc2_)
  217.       {
  218.          this.buildScrollbar(_loc3_,_loc2_);
  219.       }
  220.       else
  221.       {
  222.          this.removeScrollbar();
  223.       }
  224.    }
  225.    function showDisclaimScroll(tf)
  226.    {
  227.       Object.registerClass("disclaimScroll",application.screens.DisclaimScrollScreen);
  228.       this.disclaimScroll = application.screens.DisclaimScrollScreen(this.internalContent.attachMovie("disclaimScroll","disclaimScroll" + this.instCounter,this.instCounter));
  229.       this.instCounter = this.instCounter + 1;
  230.       this.disclaimScroll.setConfigProvider(this.configObj);
  231.       this.disclaimScroll.setTextField(tf);
  232.       this.disclaimScroll.setContainer(this);
  233.       this.disclaimScroll.build();
  234.    }
  235.    function openRegistration()
  236.    {
  237.       application.core.ContentManager.getInstance().openRegistration();
  238.    }
  239.    function buildScrollbar(viewWidth, viewHeight)
  240.    {
  241.       if(this.scrollBar == null)
  242.       {
  243.          var _loc3_ = viewWidth;
  244.          var _loc2_ = viewHeight;
  245.          var _loc6_ = this.registrationBlind._x;
  246.          var _loc5_ = this.nav._y;
  247.          this.mask = this.internalContent.createEmptyMovieClip("mask" + this.instCounter,this.instCounter);
  248.          this.instCounter = this.instCounter + 1;
  249.          this.mask.clear();
  250.          this.mask.beginFill(0,0);
  251.          this.mask.moveTo(0,0);
  252.          this.mask.lineTo(0,_loc2_);
  253.          this.mask.lineTo(_loc3_,_loc2_);
  254.          this.mask.lineTo(_loc3_,0);
  255.          this.mask.lineTo(0,0);
  256.          this.mask.endFill();
  257.          this.mask._x = int(_loc6_);
  258.          this.mask._y = int(_loc5_);
  259.          this.externalContent.setMask(this.mask);
  260.          Object.registerClass("dummy",application.screens.ScrollBarScreen);
  261.          this.scrollBar = application.screens.ScrollBarScreen(this.internalContent.attachMovie("dummy","scrollBar" + this.instCounter,this.instCounter));
  262.          this.instCounter = this.instCounter + 1;
  263.          this.scrollBar.setContent(this.externalContent,viewHeight);
  264.       }
  265.       else
  266.       {
  267.          this.scrollBar.setContent(this.externalContent,viewHeight);
  268.          this.externalContent.setMask(this.mask);
  269.       }
  270.    }
  271.    function removeScrollbar()
  272.    {
  273.       this.mask.clear();
  274.       this.mask.removeMovieClip();
  275.       this.scrollBar.removeMovieClip();
  276.       this.scrollBar = null;
  277.    }
  278.    function openInstaller()
  279.    {
  280.    }
  281.    function openSoftware(id)
  282.    {
  283.    }
  284.    function showInfo(id)
  285.    {
  286.    }
  287.    function updateView(height, showBlind, id)
  288.    {
  289.    }
  290.    function getScrollBar()
  291.    {
  292.       return this.scrollBar;
  293.    }
  294.    function getMask()
  295.    {
  296.       return this.mask;
  297.    }
  298. }
  299.