Advertisement
bombillo

Clue to fix the Scroll bug

Oct 10th, 2019
476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.79 KB | None | 0 0
  1.        
  2.         public  function scrollerMouseWheel (e:MouseEvent):void
  3.         {
  4.             if (e.stageX > Marketplace.Mask.x &&
  5.                 e.stageX < Marketplace.Mask.x + Marketplace.Mask.width + 45 &&
  6.                 e.stageY > Marketplace.Mask.y &&
  7.                 e.stageY < Marketplace.Mask.y + Marketplace.Mask.height)
  8.             {
  9.                 var dist:Number = (Marketplace.Slots.height - Marketplace.Mask.height) / 177; // 177 edit this
  10.                 var h = Scroller.Field.height - Scroller.Trigger.height + 26;  // 177 edit this
  11.                 dist = h / dist;
  12.  
  13.                 if (e.delta > 0)
  14.                     handleScrollerUpDown(-dist);
  15.                 else
  16.                     handleScrollerUpDown(dist);
  17.             }
  18.         }
  19.  
  20.         public  function scrollerMouseWheel2 (e:MouseEvent):void
  21.         {
  22.             if (e.stageX > Marketplace.PopupTransactions.Mask.x &&
  23.                 e.stageX < Marketplace.PopupTransactions.Mask.x + Marketplace.PopupTransactions.Mask.width + 45 && // 177 edit this
  24.                 e.stageY > Marketplace.PopupTransactions.Mask.y &&
  25.                 e.stageY < Marketplace.PopupTransactions.Mask.y + Marketplace.PopupTransactions.Mask.height)
  26.             {
  27.                 var dist:Number = (Marketplace.PopupTransactions.Slots.height - Marketplace.PopupTransactions.Mask.height) / 48; // 177 edit this
  28.                 var h = Scroller2.Field.height - Scroller2.Trigger.height + 26; // 177 edit this
  29.                 dist = h / dist;
  30.  
  31.                 if (e.delta > 0)
  32.                     handleScrollerUpDown2(-dist);
  33.                 else
  34.                     handleScrollerUpDown2(dist);
  35.             }
  36.         }
  37.  
  38.  
  39.         /// search for this in somewhere
  40.         Marketplace.Slots.y = 284.45; // play with the number comparing from flash design mask height size
  41.  
  42.         public  function scrollItems(e:Event)
  43.         {
  44.             var a = Scroller.Field.y;
  45.             var b = Scroller.Trigger.y;
  46.             var dist = (Scroller.Field.y - Scroller.Trigger.y);
  47.             var h = Marketplace.Slots.height;
  48.             var h1 = Scroller.Field.height - Scroller.Trigger.height;
  49.             var mh = Marketplace.Mask.height;
  50.             h -= mh;
  51.             h /= h1;
  52.        
  53.             var dest:Number = dist * h;
  54.             var step:Number = int (dest / 173); // 173  edit this
  55.            
  56.             if (Marketplace.Slots.y != (284.45 + (174 * step))) // 173  edit this
  57.             {
  58.                 Tweener.addTween(Marketplace.Slots, {y:(284.45 + (174 * step)), time:0.25, transition:"linear"}); // 174 edit this
  59.             }
  60.         }
  61.        
  62.         public  function scrollItems2(e:Event)
  63.         {
  64.             var a = Scroller2.Field.y;
  65.             var b = Scroller2.Trigger.y;
  66.             var dist = (Scroller2.Field.y - Scroller2.Trigger.y);
  67.             var h = Marketplace.PopupTransactions.Slots.height;
  68.             var h1 = Scroller2.Field.height - Scroller2.Trigger.height;
  69.             var mh = Marketplace.PopupTransactions.Mask.height;
  70.             h -= mh;
  71.             h /= h1;
  72.        
  73.             var dest:Number = dist * h;
  74.             var step:Number = int (dest / 48); // 48 edit this
  75.            
  76.             if (Marketplace.PopupTransactions.Slots.y != (329+(48 * step))) // 48 edit this
  77.             {
  78.                 Tweener.addTween(Marketplace.PopupTransactions.Slots, {y:329+(48 * step), time:0.25, transition:"linear"}); // 48 edit this
  79.             }
  80.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement