Have a text that scrolls automatically in a text field
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Have a text that scrolls automatically in a text field
Hi, do you know a way to have a text that scrolls automatically in a text field to use in an about box instead to force user to use the dragbar? It would be nice for users...
Re: Have a text that scrolls automatically in a text field
Hi Mag,
Build a loop/send-in-time to increment the vScroll property of the field.
I'm pretty sure you know what I'm talking about, but if not I can add more.
Simon
Build a loop/send-in-time to increment the vScroll property of the field.
I'm pretty sure you know what I'm talking about, but if not I can add more.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Have a text that scrolls automatically in a text field

Re: Have a text that scrolls automatically in a text field
Rats!
You said "best practice"...
I'm not that good
But things I've seen a lot
local tScrollValue
on scrollFld
add 1 to tScrollValue --work with this, 1 px maybe too little/too hard on the engine
set the vScroll of fld "about" to tScrollValue
send tScrollValue to me in 10 milliseconds --work with this as well
end scrollFld
I'm not sure if this is "best practice". And there is nothing in there that takes care of when you reach the bottom, but it won't explode
Simon
You said "best practice"...
I'm not that good

But things I've seen a lot
local tScrollValue
on scrollFld
add 1 to tScrollValue --work with this, 1 px maybe too little/too hard on the engine
set the vScroll of fld "about" to tScrollValue
send tScrollValue to me in 10 milliseconds --work with this as well
end scrollFld
I'm not sure if this is "best practice". And there is nothing in there that takes care of when you reach the bottom, but it won't explode

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Have a text that scrolls automatically in a text field
Thank you so much for your help Simon, so I implemented this code in the Card script. Please feel free to suggest improvements...

Code: Select all
local tScrollValue, scrollOn
on preOpenCard
set the vScroll of fld "creditsTextFiled" to "10" -- where the text begins, previous lines are empty
end preOpenCard
on openCard
put "yes" into scrollOn
scrollFld
end openCard
on closeCard
put "off" into scrollOn
end closeCard
on scrollFld
if scrollON = "yes" then
if vScroll of field "creditsTextFiled" < tScrollValue then -- it's at end, reset it at the begin
put "0" into tScrollValue
end if
-- if the mouseLoc is within the rect of field "creditsTextFiled" then
if the mouse is down then
else
add 1 to tScrollValue
set the vScroll of fld "creditsTextFiled" to tScrollValue
end if
send "scrollFld" to me in 30 milliseconds
end if
end scrollFld
Re: Have a text that scrolls automatically in a text field
Looks good, actually you have done some interesting things.
If you get an error on closeCard I have a suggestion for that, but only if your solution isn't working for you.
put "0" into tScrollValue
I think should be
put "10" into tScrollValue
from your preOpenCard
Oh and I think you left out:
on preOpenCard
put "Simon is Super-Duper" & cr before fld "creditsTextFiled"
Simon
If you get an error on closeCard I have a suggestion for that, but only if your solution isn't working for you.
put "0" into tScrollValue
I think should be
put "10" into tScrollValue
from your preOpenCard
Oh and I think you left out:
on preOpenCard
put "Simon is Super-Duper" & cr before fld "creditsTextFiled"

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Have a text that scrolls automatically in a text field
Hi Simon,
I get an error:
...
Compilation error: not a boolean value
Where: line 2
Hint: "Simon is super-Duper"
...
Best
Klaus
I get an error:
...
Compilation error: not a boolean value
Where: line 2
Hint: "Simon is super-Duper"
...



Best
Klaus
Re: Have a text that scrolls automatically in a text field
Klaus,
Capitalize the third "S"
That should clear it up
Simon
Capitalize the third "S"
That should clear it up



Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Have a text that scrolls automatically in a text field
And shouldn't that field name be "creditTaxFiled"?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com