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

How do you set limits on an automatic vertical scroll?

New Here ,
Aug 01, 2013 Aug 01, 2013

Hello Adobe Community,

I'm constructing a vertical timeline that ranges from 1978-2009.  It is obviously rather long, so instead of having the entire timeline on-screen, I have set up a window that displays 5-6 dates and has up/down arrows that scroll the content when the mouse hovers over them.  There will be more bulk and information to the timeline in the future, but this where I'm currently at.

My understanding of script/code/programming is very VERY basic.  What I have so far is a combination of a couple tutorials, and it is working perfectly other than having no limits set on it (so it continues to scroll up or down past the content into white nothingness).  In a previous version the limits were set to "window" and "track" move clips (which worked) but doesn't seem to be applying to the rest of my current script (from a different source).  I'm sure there is something missing, but I don't know what it is.

Here is my file:

http://www.sendspace.com/file/gs3zzg

Any help that somebody could give me would be much appreciated!

-Emily

TOPICS
ActionScript
373
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

correct answers 1 Correct answer

Community Expert , Aug 01, 2013 Aug 01, 2013

normally something like that would be displayed using a mask.  if the mask and scrolled movieclip both have reg points at the top, you can set limits using:

scrolled_mc.y = Math.min(scrolled_mc.y,mask_mc.y+scrolled_mc.height-mask_mc.height);

scrolled_mc.y = Math.max(scrolled_mc.y,mask_mc.y)

Translate
Community Expert ,
Aug 01, 2013 Aug 01, 2013
LATEST

normally something like that would be displayed using a mask.  if the mask and scrolled movieclip both have reg points at the top, you can set limits using:

scrolled_mc.y = Math.min(scrolled_mc.y,mask_mc.y+scrolled_mc.height-mask_mc.height);

scrolled_mc.y = Math.max(scrolled_mc.y,mask_mc.y)

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