Little AS quesiton with scroll text

i was reading this tutorial
http://www.kirupa.com/developer/flash5/scrolltext.asp
and the AS it gives me for the up and down buttons seems to only work in flash 5. The up button AS it gives is:

on (press, release, keyPress “<Up>”) {
currentScroll = scrollableText.scroll;
if (Number(currentScroll)>1) {
scrollableText.scroll = currentScroll-1;
}
}

and the down is:

on (press, release, keyPress “<Down>”) {
currentScroll = scrollableText.scroll;
if (Number(currentScroll)<Number(scrollableText.maxscroll)) {
scrollableText.scroll = Number(currentScroll)+1;
}
}

what would these be in flash mx? thx

I’m using MX and that tutorial works just fine. Let me look at your fla, maybe I can fix it for you.

ah yea you’re right it does i downloaded the final thing from the tutorial and compared it with mine and figured what was wrong…thx anwyaz…
but i was wondering, if the color of the text box thing can be changed…would you happen to know how? or would you just have to put somethin behind it so it looks like the text box is that color?

oh yea one more thing…i was wondering what this line:

scrollableText.scroll = currentScroll-1;

and

scrollableText.scroll = Number(currentScroll)+1;

meant…i guess they mean nearly the same thing. i was just wondering so in the future if i ever come across anythin it would help thx :nerd:

Honestly I’m new to AS so I’m not sure what it means, but I think one makes it scroll up and one makes it scroll down, not sure though. And if you wanna change the background of the box then just put something behind it or double click on the background symbol that kirupa used and just change the green to whatever color you like. =)

alritey thx :slight_smile:

*Originally posted by blah-de-blah *
**oh yea one more thing…i was wondering what this line:

scrollableText.scroll = currentScroll-1;

and

scrollableText.scroll = Number(currentScroll)+1;

meant…i guess they mean nearly the same thing. i was just wondering so in the future if i ever come across anythin it would help thx :nerd: **

scrollableText.scroll = currentScroll-1;

This means current scroll - 1 pixel and since it is attached to the up button it moves the text UP

scrollableText.scroll = Number(currentScroll)+1;

basically the opposite it moves the text DOWN 1 pixel and obviously you must attach it to DOWN button…maybe i dont explain well if you still dont get it just ask =)

This means current scroll - 1 pixel

Actually, since you are dealing with a text box, it scrolls one line, :stuck_out_tongue: not 1 pixel. In most other cases when you add 1 or subract 1, you are just changing the value by one pixel.