home *** CD-ROM | disk | FTP | other *** search
/ Chip 2003 November / Chip_2003-11_cd1.bin / chplus / prazdroj / cz / flash_plave.swf / scripts / frame_5 / DoAction.as
Text File  |  2003-09-24  |  5KB  |  224 lines

  1. function getArray(str, d)
  2. {
  3.    var arr;
  4.    var str;
  5.    var d;
  6.    str = String(str);
  7.    d = String(d);
  8.    arr = str.split(d);
  9.    return arr;
  10. }
  11. function setBannerF(bPath)
  12. {
  13.    var bPath;
  14.    i = 0;
  15.    while(i < bCount)
  16.    {
  17.       if(cPath[i] == bPath)
  18.       {
  19.          tellTarget(cPath[i])
  20.          {
  21.             gotoAndStop("d");
  22.          }
  23.       }
  24.       else
  25.       {
  26.          tellTarget(cPath[i])
  27.          {
  28.             gotoAndStop("n");
  29.          }
  30.       }
  31.       i++;
  32.    }
  33.    bSelect = bPath;
  34.    _root.bCurrent = bPath;
  35.    loadMovie(bArr[Number(bPath.substring(9,bPath.length))][1],_root.banner);
  36.    _root.bShow[Number(bPath.substring(9,bPath.length))] = 1;
  37. }
  38. function setBannerL(bPath)
  39. {
  40.    var bPath;
  41.    i = 0;
  42.    while(i < bCount)
  43.    {
  44.       if(cPath[i] == bPath)
  45.       {
  46.          tellTarget(cPath[i])
  47.          {
  48.             gotoAndStop("d");
  49.          }
  50.       }
  51.       else
  52.       {
  53.          tellTarget(cPath[i])
  54.          {
  55.             gotoAndStop("n");
  56.          }
  57.       }
  58.       i++;
  59.    }
  60.    bSelect = bPath;
  61.    _root.bCurrent = bPath;
  62. }
  63. function setBannerD(bPath)
  64. {
  65.    var bPath;
  66.    i = 0;
  67.    while(i < bCount)
  68.    {
  69.       if(cPath[i] == bPath)
  70.       {
  71.          tellTarget(cPath[i])
  72.          {
  73.             gotoAndStop("d");
  74.          }
  75.       }
  76.       else
  77.       {
  78.          tellTarget(cPath[i])
  79.          {
  80.             gotoAndStop("n");
  81.          }
  82.       }
  83.       i++;
  84.    }
  85.    bSelect = bPath;
  86.    _root.bCurrent = bPath;
  87.    loadMovie(bArr[Number(bPath.substring(9,bPath.length))][1],_root.banner);
  88.    _root.getUrl(bPath);
  89. }
  90. function getUrl(bPath)
  91. {
  92.    var bPath;
  93.    var url;
  94.    var win;
  95.    var ftr;
  96.    url = bArr[Number(bPath.substring(9,bPath.length))][2];
  97.    win = bArr[Number(bPath.substring(9,bPath.length))][3];
  98.    ftr = bArr[Number(bPath.substring(9,bPath.length))][4];
  99.    nam = String(bPath.substring(8,bPath.length));
  100.    jstr = "javascript:FlashControlNewWin(\'" + url + "\',\'" + this._name + "\',\'" + ftr + "\')";
  101.    redirStrJava = "javascript:getRedir(\'" + url + "\',\'" + nam + "\',\'" + ftr + "\',\'" + win + "\')";
  102.    redirStr = "javascript:getRedir(\'" + url + "\',\'" + nam + "\',\'width=760 height=560 scrollbars=1,status=1,toolbar=1,menubar=1,location=1,resizable=1 resize\',\'" + win + "\')";
  103.    if(win == "_java")
  104.    {
  105.       getURL(redirStrJava,"");
  106.    }
  107.    else
  108.    {
  109.       getURL(redirStr,"");
  110.    }
  111. }
  112. function setBannerR(bPath)
  113. {
  114.    var bPath;
  115.    i = 0;
  116.    while(i < bCount)
  117.    {
  118.       if(cPath[i] == bPath)
  119.       {
  120.          tellTarget(cPath[i])
  121.          {
  122.             gotoAndStop("r");
  123.          }
  124.       }
  125.       else if(cPath[i] != bSelect)
  126.       {
  127.          tellTarget(cPath[i])
  128.          {
  129.             gotoAndStop("n");
  130.          }
  131.       }
  132.       i++;
  133.    }
  134. }
  135. function loadBanner()
  136. {
  137.    var bPath;
  138.    bPath = random(_root.bCount);
  139.    var full;
  140.    full = true;
  141.    i = 0;
  142.    while(i < bCount)
  143.    {
  144.       if(bShow[i] == 0)
  145.       {
  146.          full = false;
  147.          break;
  148.       }
  149.       i++;
  150.    }
  151.    if(full == true)
  152.    {
  153.       i = 0;
  154.       while(i < bCount)
  155.       {
  156.          bShow[i] = 0;
  157.          i++;
  158.       }
  159.    }
  160.    if(_root.bShow[bPath] != 0)
  161.    {
  162.       do
  163.       {
  164.          bPath = random(_root.bCount);
  165.       }
  166.       while(_root.bShow[bPath] == 1);
  167.       
  168.    }
  169.    _root.bShow[bPath] = 1;
  170.    bPath = "_level0.c" + bPath;
  171.    _root.attachMovie("banner","bannerload",102);
  172.    _root.bannerload._x = -200;
  173.    _root.bannerload._y = -200;
  174.    loadMovie(bArr[Number(bPath.substring(9,bPath.length))][1],_root.bannerload);
  175.    _root.loadBannerPath = bPath;
  176. }
  177. function getText(bName)
  178. {
  179.    var bName;
  180.    var searchStr;
  181.    var subStr;
  182.    var textSource;
  183.    var text;
  184.    searchStr = "/n";
  185.    textSource = _root.bArr[Number(bName.substring(1,bName.length))][0];
  186.    i = 0;
  187.    while(i < textSource.length)
  188.    {
  189.       subStr = textSource.substr(i,searchStr.length);
  190.       if(subStr != searchStr)
  191.       {
  192.          text += textSource.substring(i,i + 1);
  193.       }
  194.       else if(subStr == searchStr)
  195.       {
  196.          text += "\n";
  197.          i += searchStr.length - 1;
  198.       }
  199.       i++;
  200.    }
  201.    return text;
  202. }
  203. function setSpeed(yMouse)
  204. {
  205.    _root.speed = - yMouse / 24;
  206.    if(_root.speed < 0.5 and -0.5 < _root.speed)
  207.    {
  208.       _root.speed = 0;
  209.    }
  210. }
  211. function getTextColor(cislo_banneru)
  212. {
  213.    var rgb_textu;
  214.    var cislo_banneru;
  215.    _root.bArr[cislo_banneru][4];
  216.    if(_root.bArr[cislo_banneru][4] != undefined)
  217.    {
  218.       rgb_textu = new Number();
  219.       rgb_textu = parseInt(_root.bArr[cislo_banneru][4]);
  220.       my_color = new Color("_level0.c" + cislo_banneru + ".text_container");
  221.       my_color.setRGB(rgb_textu);
  222.    }
  223. }
  224.