




B1002 - Is it possible to have text scroll by in a window like a ticker tape?

by - Joseph Ganci

Is it possible to have text scroll by in a window like a ticker tape? I'm relatively new with Authorware..... HELP!!

This is an interesting question! There are several ways to do this. One approach follows: 

The first Calculation icon contains the short script:   

    message := "This is a test of the Authorware Broadcast System. "
    pause := .1 -- the number of seconds to pause between each letter movement 
You can change the contents of the message you wish to scroll in the first line. You can make it as short or as long as you like, within reason. In the second line, you can stipulate how long to wait between text movement. In the above line, Authorware will pause a tenth of a second between text movements. 

The Display icon contains the following fields: 
    Ticker tape:
It is best to use a non-proportional font, such as Courier since the text will scroll in a more measured fashion. Note also that the Display icon needs to be set to Update Displayed Variables in its Effects dialog box. 

The Display icon has a Calculation ornament attached which contains the following script: 
    count := CharCount(message)
    screen_message := RepeatString(" ",count) 
The first script line places the length of the line in the variable count. The second line initializes the message we show on the screen to be a series of blanks, one blank for every character in the message. 

The Decision icon is set to Sequential, Repeat Until TRUE which has FALSE filled into its field. This basically tells Authorware to repeat forever. Obviously, you will want to replace the word FALSE with whatever conditional expression you wish to stop the text from scrolling. 

The Wait icon is set to wait pause seconds. Its Calculation ornament contains the following line: 
    screen_message := SubStr(screen_message,2,count) ^ SubStr(message,MOD(RepCount-1,count)+1,MOD(RepCount-1,count)+1) 
This reconstructs the string you see on the screen to be whatever was there first minus the first character and attaching on the end the next available character in the string. So if the message is "Dog and cat" and the string on the screen is showing "Dog an", the string will next become "og and". 

Download the code from the Download area

There are 0 reviews
Add your review