home *** CD-ROM | disk | FTP | other *** search
/ PCNet 2006 March / PCnet 2006-06.3.iso / Apps / Flash / FDBuilder1160CNET.exe / Examples / Capturing.swf / scripts / DefineSprite_50 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-04-02  |  1021 b   |  60 lines

  1. function initScroll()
  2. {
  3.    if(p.index_mc._height > hbase)
  4.    {
  5.       _visible = true;
  6.       hindex = p.index_mc._height;
  7.       bar._height = hbase * p.h / hindex;
  8.       d = hbase - 22 - bar._height;
  9.       bar._y = (- p.index_mc._y) * d / (hindex - hbase) + lup;
  10.       p.box_mc._xscale = _X;
  11.    }
  12.    else
  13.    {
  14.       _visible = false;
  15.    }
  16. }
  17. function barDrag()
  18. {
  19.    startDrag(bar,0,-6,lup,-6,lup + d);
  20. }
  21. function barStop()
  22. {
  23.    stopDrag();
  24.    go();
  25. }
  26. function arrowGo(n)
  27. {
  28.    var m = bar._y + n * 5 * hbase / hindex;
  29.    if(m < lup or m > lup + d)
  30.    {
  31.       if(m < lup)
  32.       {
  33.          bar._y = lup;
  34.       }
  35.       else
  36.       {
  37.          bar._y = lup + d;
  38.       }
  39.       go();
  40.    }
  41.    else
  42.    {
  43.       bar._y = m;
  44.       go();
  45.    }
  46. }
  47. function go()
  48. {
  49.    p.index_mc._y = (- (bar._y - lup)) * (hindex - hbase) / d;
  50. }
  51. p = _parent;
  52. colLight = p.colLight;
  53. colText = p.colText;
  54. colBase = p.colBase;
  55. down._y = p.h - 10;
  56. _visible = false;
  57. var hbase = p.h;
  58. var lup = 11;
  59. var d;
  60.