Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : Scrolling Text Action Script



James Fee
2/10/2004 4:34:28 PM
I think what you want is the following:
for the "Up" button:
on(click){
_parent.Findings.scroll-=1;
}

for the "down" button:
on(click){
_parent.Findings.scroll+=1;
}

[quoted text, click to view]

cdeg
2/10/2004 8:43:57 PM
I am trying to create scrolling text using scrolling buttons. However, when I
Control > Test Movie, I get a script error message

These are the steps I have followed to create the scrolling text

1) Created a Dynamic text field (Multiline) with an instance name of Findings.
2)With the Dynamic text field selected, went to top menu and chose Text >
Scrollabl
2) Filled the Dynamic text field with tex
3) Created two buttons, converted them to symbols, checking "Button" as the
behavior. The instance names, respectively, were "Up" and "Down
4) Selected the "Up" button on the Stag
5) In the Actions panel, navigated from Built-in classes >Movie > TextField >
Properties and then double-clicked Scroll to add it to the Script pane. I
changed instanceName.scroll to Findings.scroll and added += 1; so that the
script appeared as Findings.scroll += 1
6) I repeated steps 4 & 5 for the "Down" button and changed the script to read
Findings.scroll -= 1
7) Did Control > Test movie and received the message of

**Error** Screen=slide1, layer=Layer 1, frame=1:Line 1: Statement must appear
within on handle
Findings.scroll -= 1

**Error** Screen=slide1, layer=Layer 1, frame=1:Line 1: Statement must appear
within on handle
Findings.scroll += 1

Total ActionScript Errors: 2 Reported Errors:

Also, when in the Action Panel (with a button selected on the stage), if I
double-click Scroll (which places the script in the Action Script pane) and,
without changing anything in the script, then click "Check syntax" it tells me
that there are syntax errors and gives me the same error message as above

Could someone please tell me what I have done wrong? And also what Statement
must appear within on handler means and how I can fix it

Thanks very much. (If this post appears twice, I apologize. I tried to send
it once before and got disconnected from the site
Hiltonkeith
2/10/2004 9:54:36 PM
Hi cdeg

We used scrolling text for a project at work. Following is the script for the
up button (assuming the text field is called "Findings")

on(release)
Findings.scroll -=


...and the down button

on(release)
Findings.scroll +=


I think you just need to add the on(release) handler to your code. I'm
certainly no expert, but we had some difficulty with this very issue here, and
that is how we solved it

Good luck
Hilto

cdeg
2/10/2004 10:12:34 PM
You were right, I did need a line referring to the mouse click action, which
Hilton happened to know after struggling with the same problem. I wish they
would have put that in the User Manual. Thanks so much

You wrote: (Sorry,I haven't figured out how to properly execute the "quote"
function on this website yet

[quoted text, click to view]
for the "Up" button
on(click)
_parent.Findings.scroll-=1


for the "down" button
on(click)
_parent.Findings.scroll+=1




"cdeg" <cdegidio@earthlink.net> wrote in messag
news:c0bfqd$iv8$1@forums.macromedia.com..
[quoted text, click to view]


cdeg
2/10/2004 10:23:39 PM
Thank you SO much, Hilton. It worked. I have spent 5 hours (I am a reasonably
"junior" learner of Flash) trying to figure this out before I found this site.
The FlashMX User Manual gave a different script for the scrolling buttons and I
could not figure out why it wasn't working

Would you happen to know how to make the scrolling run smoothly as opposed to
scrolling one text-sized box of text at a time? If not, I will post a separate
message asking this question. Thanks again

Carme

[quoted text, click to view]
up button (assuming the text field is called "Findings")

on(release)
Findings.scroll -=


...and the down button

on(release)
Findings.scroll +=


I think you just need to add the on(release) handler to your code. I'm
certainly no expert, but we had some difficulty with this very issue here, and
that is how we solved it.

"cdeg" <cdegidio@earthlink.net> wrote in messag
news:c0bfqd$iv8$1@forums.macromedia.com..
[quoted text, click to view]



[quoted text, click to view]

We used scrolling text for a project at work. Following is the script for the
up button (assuming the text field is called "Findings")

on(release)
Findings.scroll -=


...and the down button

on(release)
Findings.scroll +=


I think you just need to add the on(release) handler to your code. I'm
certainly no expert, but we had some difficulty with this very issue here, and
that is how we solved it

Good luck
Hilto

Hiltonkeith
2/10/2004 10:58:52 PM
Hi Carmen,

I know you can scroll more than one line at a time (use something like +=3
instead of +=1), but I don't know how to make it scroll *smoothly*. I'm pretty
junior myself, sorry! It can be done; you see it out there all over the place.
When you find out, please let me know. It's good info to have

Thanks
Hilto
cdeg
2/10/2004 11:22:40 PM
Thanks, Hilton. Currently it scrolls the number of lines that fill up the text
box at a time, which is what I think the += 1 means. (I am not positive about
the meaning of the += 1) I.e., You see the first 6 lines of text (which is the
maximum number of lines that the box, given its size, can show at a time) and
then, when you click the button, it jumps down to the next 6 lines, etc. It's
hard to explain. I will do a search of the forum to see if anyone has asked the
question before and, if not (or if I don't understand the response), I will
post a message asking it myself

[quoted text, click to view]
instead of +=1), but I don't know how to make it scroll *smoothly*. I'm pretty
junior myself, sorry! It can be done; you see it out there all over the place.
When you find out, please let me know. It's good info to have.
Hiltonkeith
2/20/2004 6:01:04 PM
There is a tutorial on scrolling text (smoothly) here:
http://www.gurusnetwork.com/tutorials/flash/scroll_text/scroll_text2.html

I tried it, it works. Good luck!
AddThis Social Bookmark Button