Search tutorials
Finishing the scroll track
The scroll track is already in place and its instance name is "scroll_track", right? Good! Now let's add the following code to our functions frame:
On the next page, I'll have a summary of all the code we need, and where it should be.
The scroll track is already in place and its instance name is "scroll_track", right? Good! Now let's add the following code to our functions frame:
scroll_track.useHandCursor = false;
scroll_track.onPress = function () {
rec_y = _root._ymouse - this._parent._y;
if (rec_y <%gt%> scroll_thumb._y) {
pressed = 5;
} else {
pressed = -5;
}
scrollIt();
checkIfPressed = setInterval(callBack, 500);
}
scroll_track.onRelease = scroll_track.onReleaseOutside = stopScroll;
One important thing to note here is that the number 5 in my code is one
less than the maximum number of lines that can be displayed in the text
field at one time. So if your text fields holds 20 lines, for example,
you would use 19 and -19 in your code instead. And that's about it!
On the next page, I'll have a summary of all the code we need, and where it should be.
| » Level Advanced |
|
Added: 2002-03-23 Rating: 7 Votes: 116 |
| » Author |
| I have been flashing for almost two years, first at an online learning company and now at a university. My dream is to one day work for Macromedia as an ActionScript Engineer! |
| » Download |
| Download the files used in this tutorial. |
| Download (68 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!