home *** CD-ROM | disk | FTP | other *** search
/ Sears Catalog 2006 Spring/Summer (French Canadian) / SearsCanada-AutomneEte2006-FrenchVersion-WinMac.bin / fr / gift / pricematchguarantee.swf / scripts / DefineSprite_101_ultimateScroller_button_down / frame_1 / DoAction.as
Text File  |  2005-11-21  |  8KB  |  267 lines

  1. this.useHandCursor = false;
  2. this._focusRect = false;
  3. setSkins();
  4. this.onPress = function()
  5. {
  6.    if(this._parent.enabled == false)
  7.    {
  8.       gotoAndStop("disabled");
  9.       return undefined;
  10.    }
  11.    this._parent.scrollDown();
  12.    this._parent.scrollDelay = true;
  13.    this._parent.delayTimer = setInterval(this._parent,"clearDelay",300);
  14.    this._parent.scrolling = "DOWN";
  15.    gotoAndStop("down");
  16.    updateAfterEvent();
  17. };
  18. this.onRelease = this.onReleaseOutside = function()
  19. {
  20.    if(this._parent.enabled == false)
  21.    {
  22.       gotoAndStop("disabled");
  23.       return undefined;
  24.    }
  25.    this._parent.scrolling = false;
  26.    this._parent.clearDelay();
  27.    gotoAndStop("up");
  28.    updateAfterEvent();
  29. };
  30. this.setSkins = function()
  31. {
  32.    this.drawButtons();
  33. };
  34. this.drawButtons = function()
  35. {
  36.    w = _parent.c_scrollWidth;
  37.    h = 16;
  38.    arrowX = w / 2;
  39.    arrowY = h / 2;
  40.    x = 0;
  41.    y = 0;
  42.    this.createEmptyMovieClip("buttonG",1000);
  43.    switch(this._currentframe)
  44.    {
  45.       case 1:
  46.          if(_parent.c_buttonsVisible)
  47.          {
  48.             this.buttonG.createEmptyMovieClip("darkshadow_mc",1000);
  49.             with(this.buttonG.darkshadow_mc)
  50.             {
  51.                beginFill(_parent._parent._parent.c_darkshadow);
  52.                lineStyle();
  53.                moveTo(x,y);
  54.                lineTo(x + w,y);
  55.                lineTo(x + w,y + h);
  56.                lineTo(x,y + h);
  57.                lineTo(x,y);
  58.                endFill();
  59.             }
  60.             w -= 1;
  61.             h -= 1;
  62.             this.buttonG.createEmptyMovieClip("highlight3d_mc",1001);
  63.             with(this.buttonG.highlight3d_mc)
  64.             {
  65.                beginFill(_parent._parent._parent.c_highlight3d);
  66.                lineStyle();
  67.                moveTo(x,y);
  68.                lineTo(x + w,y);
  69.                lineTo(x + w,y + h);
  70.                lineTo(x,y + h);
  71.                lineTo(x,y);
  72.                endFill();
  73.             }
  74.             x += 1;
  75.             y += 1;
  76.             w -= 1;
  77.             h -= 1;
  78.             this.buttonG.createEmptyMovieClip("shadow_mc",1002);
  79.             with(this.buttonG.shadow_mc)
  80.             {
  81.                beginFill(_parent._parent._parent.c_shadow);
  82.                lineStyle();
  83.                moveTo(x,y);
  84.                lineTo(x + w,y);
  85.                lineTo(x + w,y + h);
  86.                lineTo(x,y + h);
  87.                lineTo(x,y);
  88.                endFill();
  89.             }
  90.             w -= 1;
  91.             h -= 1;
  92.             this.buttonG.createEmptyMovieClip("highlight_mc",1003);
  93.             with(this.buttonG.highlight_mc)
  94.             {
  95.                beginFill(_parent._parent._parent.c_highlight);
  96.                lineStyle();
  97.                moveTo(x,y);
  98.                lineTo(x + w,y);
  99.                lineTo(x + w,y + h);
  100.                lineTo(x,y + h);
  101.                lineTo(x,y);
  102.                endFill();
  103.             }
  104.             x += 1;
  105.             y += 1;
  106.             w -= 1;
  107.             h -= 1;
  108.             this.buttonG.createEmptyMovieClip("face_mc",1004);
  109.             with(this.buttonG.face_mc)
  110.             {
  111.                beginFill(_parent._parent._parent.c_face);
  112.                lineStyle();
  113.                moveTo(x,y);
  114.                lineTo(x + w,y);
  115.                lineTo(x + w,y + h);
  116.                lineTo(x,y + h);
  117.                lineTo(x,y);
  118.                endFill();
  119.             }
  120.          }
  121.          if(_parent.c_arrowsVisible)
  122.          {
  123.             this.buttonG.attachMovie("arrow","arrow_mc",1005,{_x:arrowX,_y:arrowY});
  124.             if(!_parent.c_arrowDefaultColor)
  125.             {
  126.                var tmp = new Color(this.buttonG.arrow_mc);
  127.                tmp.setRGB(this._parent.c_arrow);
  128.             }
  129.          }
  130.          break;
  131.       case 2:
  132.          if(_parent.c_buttonsVisible)
  133.          {
  134.             this.buttonG.createEmptyMovieClip("shadow_mc",1000);
  135.             with(this.buttonG.shadow_mc)
  136.             {
  137.                beginFill(_parent._parent._parent.c_shadow);
  138.                lineStyle();
  139.                moveTo(x,y);
  140.                lineTo(x + w,y);
  141.                lineTo(x + w,y + h);
  142.                lineTo(x,y + h);
  143.                lineTo(x,y);
  144.                endFill();
  145.             }
  146.             x += 1;
  147.             y += 1;
  148.             w -= 2;
  149.             h -= 2;
  150.             this.buttonG.createEmptyMovieClip("face_mc",1004);
  151.             with(this.buttonG.face_mc)
  152.             {
  153.                beginFill(_parent._parent._parent.c_face);
  154.                lineStyle();
  155.                moveTo(x,y);
  156.                lineTo(x + w,y);
  157.                lineTo(x + w,y + h);
  158.                lineTo(x,y + h);
  159.                lineTo(x,y);
  160.                endFill();
  161.             }
  162.          }
  163.          if(_parent.c_arrowsVisible)
  164.          {
  165.             this.buttonG.attachMovie("arrow","arrow_mc",1005,{_x:arrowX,_y:arrowY});
  166.             if(!_parent.c_arrowDefaultColor)
  167.             {
  168.                var tmp = new Color(this.buttonG.arrow_mc);
  169.                tmp.setRGB(this._parent.c_arrow);
  170.             }
  171.          }
  172.          break;
  173.       case 3:
  174.          if(_parent.c_buttonsVisible)
  175.          {
  176.             this.buttonG.createEmptyMovieClip("darkshadow_mc",1000);
  177.             with(this.buttonG.darkshadow_mc)
  178.             {
  179.                beginFill(_parent._parent._parent.c_darkshadow);
  180.                lineStyle();
  181.                moveTo(x,y);
  182.                lineTo(x + w,y);
  183.                lineTo(x + w,y + h);
  184.                lineTo(x,y + h);
  185.                lineTo(x,y);
  186.                endFill();
  187.             }
  188.             w -= 1;
  189.             h -= 1;
  190.             this.buttonG.createEmptyMovieClip("highlight3d_mc",1001);
  191.             with(this.buttonG.highlight3d_mc)
  192.             {
  193.                beginFill(_parent._parent._parent.c_highlight3d);
  194.                lineStyle();
  195.                moveTo(x,y);
  196.                lineTo(x + w,y);
  197.                lineTo(x + w,y + h);
  198.                lineTo(x,y + h);
  199.                lineTo(x,y);
  200.                endFill();
  201.             }
  202.             x += 1;
  203.             y += 1;
  204.             w -= 1;
  205.             h -= 1;
  206.             this.buttonG.createEmptyMovieClip("shadow_mc",1002);
  207.             with(this.buttonG.shadow_mc)
  208.             {
  209.                beginFill(_parent._parent._parent.c_shadow);
  210.                lineStyle();
  211.                moveTo(x,y);
  212.                lineTo(x + w,y);
  213.                lineTo(x + w,y + h);
  214.                lineTo(x,y + h);
  215.                lineTo(x,y);
  216.                endFill();
  217.             }
  218.             w -= 1;
  219.             h -= 1;
  220.             this.buttonG.createEmptyMovieClip("highlight_mc",1003);
  221.             with(this.buttonG.highlight_mc)
  222.             {
  223.                beginFill(_parent._parent._parent.c_highlight);
  224.                lineStyle();
  225.                moveTo(x,y);
  226.                lineTo(x + w,y);
  227.                lineTo(x + w,y + h);
  228.                lineTo(x,y + h);
  229.                lineTo(x,y);
  230.                endFill();
  231.             }
  232.             x += 1;
  233.             y += 1;
  234.             w -= 1;
  235.             h -= 1;
  236.             this.buttonG.createEmptyMovieClip("face_mc",1004);
  237.             with(this.buttonG.face_mc)
  238.             {
  239.                beginFill(_parent._parent._parent.c_face);
  240.                lineStyle();
  241.                moveTo(x,y);
  242.                lineTo(x + w,y);
  243.                lineTo(x + w,y + h);
  244.                lineTo(x,y + h);
  245.                lineTo(x,y);
  246.                endFill();
  247.             }
  248.          }
  249.          if(_parent.c_arrowsVisible)
  250.          {
  251.             this.buttonG.attachMovie("arrow","arrow_mc",1005,{_x:arrowX,_y:arrowY});
  252.             if(_parent.c_useDisabledColor)
  253.             {
  254.                var tmp = new Color(this.buttonG.arrow_mc);
  255.                tmp.setRGB(this._parent.c_foregroundDisabled);
  256.                break;
  257.             }
  258.             break;
  259.          }
  260.    }
  261.    delete x;
  262.    delete y;
  263.    delete w;
  264.    delete h;
  265. };
  266. stop();
  267.