home *** CD-ROM | disk | FTP | other *** search
/ Sears Catalog 2006 Spring/Summer (French Canadian) / SearsCanada-AutomneEte2006-FrenchVersion-WinMac.bin / fr / resourcecentre.swf / scripts / DefineSprite_5_ultimateScroller_button_left / frame_1 / DoAction.as
Text File  |  2005-12-05  |  8KB  |  269 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.scrollUp();
  12.    this._parent.scrollDelay = true;
  13.    this._parent.delayTimer = setInterval(this._parent,"clearDelay",300);
  14.    this._parent.scrolling = "UP";
  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 = 16;
  37.    h = _parent.c_scrollWidth;
  38.    arrowX = w / 2;
  39.    arrowY = h / 2;
  40.    x = 0;
  41.    y = 0;
  42.    this.createEmptyMovieClip("buttonG",1000);
  43.    this.buttonG._rotation = 90;
  44.    this.buttonG._x = 16;
  45.    switch(this._currentframe)
  46.    {
  47.       case 1:
  48.          if(_parent.c_buttonsVisible)
  49.          {
  50.             this.buttonG.createEmptyMovieClip("darkshadow_mc",1000);
  51.             with(this.buttonG.darkshadow_mc)
  52.             {
  53.                beginFill(_parent._parent._parent.c_darkshadow);
  54.                lineStyle();
  55.                moveTo(x,y);
  56.                lineTo(x + w,y);
  57.                lineTo(x + w,y + h);
  58.                lineTo(x,y + h);
  59.                lineTo(x,y);
  60.                endFill();
  61.             }
  62.             w -= 1;
  63.             h -= 1;
  64.             this.buttonG.createEmptyMovieClip("highlight3d_mc",1001);
  65.             with(this.buttonG.highlight3d_mc)
  66.             {
  67.                beginFill(_parent._parent._parent.c_highlight3d);
  68.                lineStyle();
  69.                moveTo(x,y);
  70.                lineTo(x + w,y);
  71.                lineTo(x + w,y + h);
  72.                lineTo(x,y + h);
  73.                lineTo(x,y);
  74.                endFill();
  75.             }
  76.             x += 1;
  77.             y += 1;
  78.             w -= 1;
  79.             h -= 1;
  80.             this.buttonG.createEmptyMovieClip("shadow_mc",1002);
  81.             with(this.buttonG.shadow_mc)
  82.             {
  83.                beginFill(_parent._parent._parent.c_shadow);
  84.                lineStyle();
  85.                moveTo(x,y);
  86.                lineTo(x + w,y);
  87.                lineTo(x + w,y + h);
  88.                lineTo(x,y + h);
  89.                lineTo(x,y);
  90.                endFill();
  91.             }
  92.             w -= 1;
  93.             h -= 1;
  94.             this.buttonG.createEmptyMovieClip("highlight_mc",1003);
  95.             with(this.buttonG.highlight_mc)
  96.             {
  97.                beginFill(_parent._parent._parent.c_highlight);
  98.                lineStyle();
  99.                moveTo(x,y);
  100.                lineTo(x + w,y);
  101.                lineTo(x + w,y + h);
  102.                lineTo(x,y + h);
  103.                lineTo(x,y);
  104.                endFill();
  105.             }
  106.             x += 1;
  107.             y += 1;
  108.             w -= 1;
  109.             h -= 1;
  110.             this.buttonG.createEmptyMovieClip("face_mc",1004);
  111.             with(this.buttonG.face_mc)
  112.             {
  113.                beginFill(_parent._parent._parent.c_face);
  114.                lineStyle();
  115.                moveTo(x,y);
  116.                lineTo(x + w,y);
  117.                lineTo(x + w,y + h);
  118.                lineTo(x,y + h);
  119.                lineTo(x,y);
  120.                endFill();
  121.             }
  122.          }
  123.          if(_parent.c_arrowsVisible)
  124.          {
  125.             this.buttonG.attachMovie("arrow","arrow_mc",1005,{_x:arrowX,_y:arrowY,_rotation:90,_xscale:-100,_yscale:100});
  126.             if(!_parent.c_arrowDefaultColor)
  127.             {
  128.                var tmp = new Color(this.buttonG.arrow_mc);
  129.                tmp.setRGB(this._parent.c_arrow);
  130.             }
  131.          }
  132.          break;
  133.       case 2:
  134.          if(_parent.c_buttonsVisible)
  135.          {
  136.             this.buttonG.createEmptyMovieClip("shadow_mc",1000);
  137.             with(this.buttonG.shadow_mc)
  138.             {
  139.                beginFill(_parent._parent._parent.c_shadow);
  140.                lineStyle();
  141.                moveTo(x,y);
  142.                lineTo(x + w,y);
  143.                lineTo(x + w,y + h);
  144.                lineTo(x,y + h);
  145.                lineTo(x,y);
  146.                endFill();
  147.             }
  148.             x += 1;
  149.             y += 1;
  150.             w -= 2;
  151.             h -= 2;
  152.             this.buttonG.createEmptyMovieClip("face_mc",1004);
  153.             with(this.buttonG.face_mc)
  154.             {
  155.                beginFill(_parent._parent._parent.c_face);
  156.                lineStyle();
  157.                moveTo(x,y);
  158.                lineTo(x + w,y);
  159.                lineTo(x + w,y + h);
  160.                lineTo(x,y + h);
  161.                lineTo(x,y);
  162.                endFill();
  163.             }
  164.          }
  165.          if(_parent.c_arrowsVisible)
  166.          {
  167.             this.buttonG.attachMovie("arrow","arrow_mc",1005,{_x:arrowX,_y:arrowY,_rotation:90,_xscale:-100,_yscale:100});
  168.             if(!_parent.c_arrowDefaultColor)
  169.             {
  170.                var tmp = new Color(this.buttonG.arrow_mc);
  171.                tmp.setRGB(this._parent.c_arrow);
  172.             }
  173.          }
  174.          break;
  175.       case 3:
  176.          if(_parent.c_buttonsVisible)
  177.          {
  178.             this.buttonG.createEmptyMovieClip("darkshadow_mc",1000);
  179.             with(this.buttonG.darkshadow_mc)
  180.             {
  181.                beginFill(_parent._parent._parent.c_darkshadow);
  182.                lineStyle();
  183.                moveTo(x,y);
  184.                lineTo(x + w,y);
  185.                lineTo(x + w,y + h);
  186.                lineTo(x,y + h);
  187.                lineTo(x,y);
  188.                endFill();
  189.             }
  190.             w -= 1;
  191.             h -= 1;
  192.             this.buttonG.createEmptyMovieClip("highlight3d_mc",1001);
  193.             with(this.buttonG.highlight3d_mc)
  194.             {
  195.                beginFill(_parent._parent._parent.c_highlight3d);
  196.                lineStyle();
  197.                moveTo(x,y);
  198.                lineTo(x + w,y);
  199.                lineTo(x + w,y + h);
  200.                lineTo(x,y + h);
  201.                lineTo(x,y);
  202.                endFill();
  203.             }
  204.             x += 1;
  205.             y += 1;
  206.             w -= 1;
  207.             h -= 1;
  208.             this.buttonG.createEmptyMovieClip("shadow_mc",1002);
  209.             with(this.buttonG.shadow_mc)
  210.             {
  211.                beginFill(_parent._parent._parent.c_shadow);
  212.                lineStyle();
  213.                moveTo(x,y);
  214.                lineTo(x + w,y);
  215.                lineTo(x + w,y + h);
  216.                lineTo(x,y + h);
  217.                lineTo(x,y);
  218.                endFill();
  219.             }
  220.             w -= 1;
  221.             h -= 1;
  222.             this.buttonG.createEmptyMovieClip("highlight_mc",1003);
  223.             with(this.buttonG.highlight_mc)
  224.             {
  225.                beginFill(_parent._parent._parent.c_highlight);
  226.                lineStyle();
  227.                moveTo(x,y);
  228.                lineTo(x + w,y);
  229.                lineTo(x + w,y + h);
  230.                lineTo(x,y + h);
  231.                lineTo(x,y);
  232.                endFill();
  233.             }
  234.             x += 1;
  235.             y += 1;
  236.             w -= 1;
  237.             h -= 1;
  238.             this.buttonG.createEmptyMovieClip("face_mc",1004);
  239.             with(this.buttonG.face_mc)
  240.             {
  241.                beginFill(_parent._parent._parent.c_face);
  242.                lineStyle();
  243.                moveTo(x,y);
  244.                lineTo(x + w,y);
  245.                lineTo(x + w,y + h);
  246.                lineTo(x,y + h);
  247.                lineTo(x,y);
  248.                endFill();
  249.             }
  250.          }
  251.          if(_parent.c_arrowsVisible)
  252.          {
  253.             this.buttonG.attachMovie("arrow","arrow_mc",1005,{_x:arrowX,_y:arrowY,_rotation:90,_xscale:-100,_yscale:100});
  254.             if(_parent.c_useDisabledColor)
  255.             {
  256.                var tmp = new Color(this.buttonG.arrow_mc);
  257.                tmp.setRGB(this._parent.c_foregroundDisabled);
  258.                break;
  259.             }
  260.             break;
  261.          }
  262.    }
  263.    delete x;
  264.    delete y;
  265.    delete w;
  266.    delete h;
  267. };