home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2009 May / MAC_easy_05_2009.iso / Video-Tutorial / start.swf / scripts / frame_1 / DoAction_10.as next >
Encoding:
Text File  |  2009-03-18  |  6.1 KB  |  231 lines

  1. function loadWelcome()
  2. {
  3.    welcome = new XML();
  4.    welcome.ignoreWhite = true;
  5.    welcome.onLoad = function(success)
  6.    {
  7.       this.clearLoadCheck();
  8.       if(success)
  9.       {
  10.          renderSettings();
  11.       }
  12.    };
  13.    welcome.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  14.    {
  15.    };
  16.    welcome.preload(fsp_path + folder + "config/welcome.xml",false);
  17. }
  18. function loadOnline()
  19. {
  20.    if(client_os == "Windows")
  21.    {
  22.       mdm.Forms.SplashForm.callFunction("output","Loading online..","");
  23.    }
  24.    online = new XML();
  25.    online.ignoreWhite = true;
  26.    online.onLoad = function(success)
  27.    {
  28.       this.clearLoadCheck();
  29.       if(success)
  30.       {
  31.          loadWelcome();
  32.       }
  33.    };
  34.    online.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  35.    {
  36.    };
  37.    online.preload(fsp_path + folder + "config/online.xml",false);
  38. }
  39. function loadHelp()
  40. {
  41.    if(client_os == "Windows")
  42.    {
  43.       mdm.Forms.SplashForm.callFunction("output","Loading help..","");
  44.    }
  45.    help = new XML();
  46.    help.ignoreWhite = true;
  47.    help.onLoad = function(success)
  48.    {
  49.       this.clearLoadCheck();
  50.       if(success)
  51.       {
  52.          loadOnline();
  53.       }
  54.    };
  55.    help.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  56.    {
  57.    };
  58.    help.preload(fsp_path + folder + "config/help.xml",false);
  59. }
  60. function loadStyles()
  61. {
  62.    if(client_os == "Windows")
  63.    {
  64.       mdm.Forms.SplashForm.callFunction("output","Loading styles..","");
  65.    }
  66.    styles = new XML();
  67.    styles.ignoreWhite = true;
  68.    styles.onLoad = function(success)
  69.    {
  70.       this.clearLoadCheck();
  71.       if(success)
  72.       {
  73.          loadHelp();
  74.       }
  75.    };
  76.    styles.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  77.    {
  78.    };
  79.    styles.preload(fsp_path + folder + "config/styles.xml",false);
  80. }
  81. function loadContent(content_info)
  82. {
  83.    if(client_os == "Windows")
  84.    {
  85.       mdm.Forms.SplashForm.callFunction("output","Loading content..","");
  86.    }
  87.    cd_content = new XML();
  88.    cd_content.ignoreWhite = true;
  89.    cd_content.onLoad = function(success)
  90.    {
  91.       this.clearLoadCheck();
  92.       if(success)
  93.       {
  94.          renderVideoDataArray(cd_content.firstChild.childNodes,[0]);
  95.       }
  96.    };
  97.    cd_content.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  98.    {
  99.       if(client_os == "Windows")
  100.       {
  101.          mdm.Forms.SplashForm.callFunction("output","Loading Content " + percentLoaded + "%","");
  102.       }
  103.    };
  104.    cd_content.preload(fsp_path + folder + "config/content.xml",false);
  105. }
  106. function loadSettings()
  107. {
  108.    if(client_os == "Windows")
  109.    {
  110.       mdm.Forms.SplashForm.callFunction("output","Loading settings..","");
  111.    }
  112.    settings = new XML();
  113.    settings.ignoreWhite = true;
  114.    settings.onLoad = function(success)
  115.    {
  116.       this.clearLoadCheck();
  117.       if(success)
  118.       {
  119.          loadStyles();
  120.       }
  121.    };
  122.    settings.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded)
  123.    {
  124.    };
  125.    settings.preload(fsp_path + folder + "config/settings.xml",false);
  126. }
  127. function loadClip(_file, _mc, __width, __height, __scale_mode, __bitmap, __function, _fade, __visible, __initialize, __callback)
  128. {
  129.    var mcLoaderListener = new Object();
  130.    var clipMCL = new MovieClipLoader();
  131.    mcLoaderListener.onLoadStart = function(targetMC)
  132.    {
  133.       targetMC._visible = false;
  134.    };
  135.    mcLoaderListener.onLoadProgress = function(targetMC, loadedBytes, totalBytes)
  136.    {
  137.    };
  138.    mcLoaderListener.onLoadComplete = function(targetMC)
  139.    {
  140.    };
  141.    mcLoaderListener.onLoadInit = function(targetMC)
  142.    {
  143.       if(__bitmap)
  144.       {
  145.          var _loc3_ = new flash.display.BitmapData(targetMC._width,targetMC._height,true,16777215);
  146.          _loc3_.draw(targetMC);
  147.          targetMC.attachBitmap(_loc3_,1,"auto",true);
  148.       }
  149.       if(__scale_mode == "fullfixed")
  150.       {
  151.          faktor1 = Stage.width / targetMC._width;
  152.          faktor2 = Stage.height / targetMC._height;
  153.          if(faktor1 > faktor2)
  154.          {
  155.             ratio = faktor1;
  156.          }
  157.          else
  158.          {
  159.             ratio = faktor2;
  160.          }
  161.          targetMC._width *= ratio;
  162.          targetMC._height *= ratio;
  163.       }
  164.       else if(__scale_mode == "widthfixed")
  165.       {
  166.          ratio = __width / targetMC._width;
  167.          targetMC._width = __width;
  168.          targetMC._height *= ratio;
  169.       }
  170.       else if(__scale_mode == "heightfixed")
  171.       {
  172.          ratio = __height / targetMC._height;
  173.          targetMC._width *= ratio;
  174.          targetMC._height = __height;
  175.       }
  176.       else if(__scale_mode == "widthfixedmasked")
  177.       {
  178.          _mc._parent.createEmptyMovieClip("target_mask_mc",_mc._parent.getNextHighestDepth());
  179.          _mc._parent.target_mask_mc._y = _mc._y;
  180.          _mc._parent.target_mask_mc._visible = false;
  181.          _root.drawBox(_mc._parent.target_mask_mc,__width,__height,16711680,16711680,100,100,"linear");
  182.          targetMC.setMask(_mc._parent.target_mask_mc);
  183.          ratio = __width / targetMC._width;
  184.          targetMC._width = __width;
  185.          targetMC._height *= ratio;
  186.       }
  187.       else
  188.       {
  189.          if(__width)
  190.          {
  191.             targetMC._width = __width;
  192.          }
  193.          if(__height)
  194.          {
  195.             targetMC._height = __height;
  196.          }
  197.       }
  198.       if(__function)
  199.       {
  200.          __function();
  201.       }
  202.       if(__visible)
  203.       {
  204.          targetMC._alpha = 0;
  205.          targetMC._visible = true;
  206.          if(_fade)
  207.          {
  208.             targetMC.tween("_alpha",100,1,"easeOutQuart");
  209.          }
  210.          else
  211.          {
  212.             targetMC._alpha = 100;
  213.          }
  214.       }
  215.       if(__initialize)
  216.       {
  217.          targetMC.init();
  218.       }
  219.       if(__callback)
  220.       {
  221.          __callback();
  222.       }
  223.       clipMCL.removeListener(mcLoaderListener);
  224.    };
  225.    mcLoaderListener.onLoadError = function(targetMC, errorCode)
  226.    {
  227.    };
  228.    clipMCL.addListener(mcLoaderListener);
  229.    clipMCL.loadClip(_file,_mc);
  230. }
  231.