Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Scrolling Flash Content With Mouse Scroll Bar

Guest
Jun 05, 2008 Jun 05, 2008
I created a custom scroll bar in AS2.0 and it works great. But now I would like the content to scroll with the mouse scroll wheel. Any ideas?
TOPICS
ActionScript
579
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 05, 2008 Jun 05, 2008
Something along these lines:

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 05, 2008 Jun 05, 2008
Awesome! I will give it a go and post the results. Thanks alot
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 05, 2008 Jun 05, 2008
Ok, so the scrolling part works now, but how do I set the scroll to the height of the mc that I am scrolling?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 11, 2008 Jun 11, 2008
LATEST
Anyone know how to fix this on Mac Osx, it works in preview but not in safari. Any pointers?

var mouseListener:Object = new Object ();
mouseListener.onMouseWheel = function (delta)
{
//contentMain._y += delta;
scrollFace._y -= delta;
if (scrollFace._y >= bottom)
{
scrollFace._y = bottom;
}
if (scrollFace._y <= top)
{
scrollFace._y = top;
}
updateContentPos ();
};
Mouse.addListener (mouseListener);

function updateContentPos ()
{
var onePercent = (bottom - top) / 100;
var scrollPerc = Math.floor ((scrollFace._y / onePercent) - 37);
var contentNewY = (contentMain._height * scrollPerc) / 100;
//trace (scrollPerc + " " + contentNewY)
contentMain._y = -contentNewY;
}
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines