home *** CD-ROM | disk | FTP | other *** search
/ Sears Catalog 2006 Spring/Summer (French Canadian) / SearsCanada-AutomneEte2006-FrenchVersion-WinMac.bin / fr / main.swf / scripts / DefineSprite_69_ultimateScroller_button_up / frame_1 / DoAction.as
Text File  |  2005-12-05  |  8KB  |  266 lines

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