
This Mini Lesson will describe using the Actions Editor to simulate text being typed into a field.

Although this could be done using the Simulation Object in ToolBook, it is a complete overkill to do so because its intended purpose is well beyond just typing text into a field.
As such this approach will simply use the an Action Timer catalog object and some programming to accomplish the task.

Add a field named Source to your page, and add the text you'd like to see auto-typed. You can leave the field visible for now, but the goal is to hide the field once you've got this logic up and running. The user will never see this field - it is being used only to store the actual text to be typed.


Add a field named AutoType to your page. This is the field the text will be auto-typed into. Adjust the field settings as needed to preset the:
As the text appears in this field, it will use these settings you apply.


What will control when the text starts typing into the field? In your case it might be the entering of the page, but for my purposes, it will be a button the user clicks.
Add a button to the page and give it the caption of Show Me.


The Action Timer catalog object is the key component to this entire process. It is the piece that is able to control the delay between the letters appearing in the field.
What's also handy about this Action Timer object is that it allows the user to interact with the page while the timer is waiting for the next letter to show. For example if you have a multiple choice question object on this page as well, the user could interact with it while your text is still typing away.
Add an Action Timer object from the Action Objects catalog category. Configure it as show below:


The logic which controls the typing effect is broken down into:
This will require you to set up one Global variable named gCurChar. Once you have done this you can refer to that global variable within the following logic.
Show Me - button
On Click
Set text of Field "AutoType" to ""
Set gCurChar to 0
Execute Play() of Action Timer "ActionTimer"
Action Timer - catalog object
On Media Timing Event
Set gCurChar to gCurChar + 1
If gCurChar <= charCount ( text of field "Source" )
Set text of Field "AutoType" to characters 1 to gCurChar of text of field "Source"
End if
| Contact Us | Legal | Privacy | Careers | +1-352-264-2800 | 866-768-6825 | Copyright © 2011, SumTotal Systems, Inc. |