PDA

View Full Version : How To Make a text scroll in an Input text area ?


el5ateer
08-14-2005, 08:53 AM
Hello everybody ,
Just wanted to make a simple player for my own use but I found it good enough to distribute among my friends :lol

However , I am using an Input Text Area to display the "path" of the file being played but sometimes it's too long so the text area only shows part of it .. So I want either to show only the file name like "songname.mp3" and not the full path , Or scroll the text being displayed .. Any answers ? :rolleyes

TJ_Tigger
08-14-2005, 10:17 AM
You can use the On Timer event to make the text scroll. What you need to do is get the text from the input and copy the left most character to the right. You will probably want to pad the end of the string as well so the file name is readable and does not run together.


--Put this code in the On Show event for the page to start the timer and pad the text
--Adjust the time for the Timer to control how fast the text will scroll
Input.SetText("Input1", Input.GetText("Input1").." ");
Page.StartTimer(200);

--Put this code in the on Timer event to cause the text to scroll
ScrollInputText("Input1");

--And here is the funciton that will cause it to scroll.
function ScrollInputText(sObject)
strText = Input.GetText(sObject);
strText = String.Right(strText, String.Length(strText)-1)..String.Left(strText, 1)
Input.SetText(sObject, strText);
end


Tigg

yosik
08-14-2005, 03:56 PM
Another alternative is to use Flash. Lots of animation possibilities there.

Yossi

el5ateer
08-14-2005, 04:30 PM
Man , I failed to apply it :rolleyes ... Can u give me an example or something ? :)

Corey
08-14-2005, 04:37 PM
Hi. Okay when you say you "failed to apply it", how far did you get? The best approach here is for you to give it a try and then post your project file as you go along if you have any problems, and we'll be happy to help you work through it. That way you learn the concept behind your project, and you will be able to apply it instantly to all future projects. Plus it's fun!!! :)

Anyhow give it a whirl and, if you run into any difficulty at all, simply post your project file as far as you've gotten, and we will be happy to assist. :yes

In the meantime if you need some free video lessons on how to get started and insert a script, etc. please visit:
http://www.autoplayzone.com

:yes :)

el5ateer
08-14-2005, 05:34 PM
Actually , My Internet Connection can not upload a project file which is approximately 2 MB :rolleyes

Corey
08-14-2005, 05:51 PM
No problem, just start a new project with only the input object present, that's all you need to work out your scroller script. You can easily upload that from any generic dialup connection. Then later, you can simply paste the object back into your main project. :yes :)

Roboblue
08-14-2005, 08:34 PM
Here is an example using TJ's code. Click on the info button to see where the code goes.

Roboblue
08-14-2005, 09:29 PM
To get a more digital readout thing going, download the zip and install the font. Then open the apz with AMS. When you publish the project, the font will be embedded in the app. It will install and un install the font as needed.

el5ateer
08-15-2005, 08:17 AM
Thnx a lot all of you .. It worked :yes

:D