Skip to main content
Inspiring
September 6, 2007
Answered

Scrolling an image horizontally

  • September 6, 2007
  • 3 replies
  • 446 views
I have a JPG image that is 6851 x 632 px. I would like to scroll the image horizontally (I would like to see 1000 x 632 at a time). How can I create a horizontal scroll bar to scroll an image like that?

Any help will be greatly appreciated.


Thank you in advanced,
This topic has been closed for replies.
Correct answer kglad
as2 is easier.

create a horizontal scrollbar in the authoring environment and convert the scrolltrack and slider into movieclips with their registration point at their left edges.

assign an onPress handler for the slider that initiates the slider's startDrag() with parameters set to the left edge of the slider track (0) and the right edge (slider track's _width minus the slider's _width) and initiate a loop that repeatedly updates your image's _x property based on the slider's _x property.

finally, assign an onRelease handler to stopDrag() and terminate your loop.

3 replies

kglad
Braniac
September 6, 2007
you're welcome.
kglad
kgladCorrect answer
Braniac
September 6, 2007
as2 is easier.

create a horizontal scrollbar in the authoring environment and convert the scrolltrack and slider into movieclips with their registration point at their left edges.

assign an onPress handler for the slider that initiates the slider's startDrag() with parameters set to the left edge of the slider track (0) and the right edge (slider track's _width minus the slider's _width) and initiate a loop that repeatedly updates your image's _x property based on the slider's _x property.

finally, assign an onRelease handler to stopDrag() and terminate your loop.
cfortin14Author
Inspiring
September 6, 2007
Thank you kglad
kglad
Braniac
September 6, 2007
as2 or as3?
cfortin14Author
Inspiring
September 6, 2007
Whichever is easier!