| A
question I see a lot is "I have a Text Entry
set up, but if the user exits the frame without
pressing the Action Key, I can't tell what was
entered. How can I get this information?"
One way is to detect that the user is leaving
the frame with a conditional or with code attached
to the next and previous buttons.
Another
way to do it is to use an Edit Windows Control.
Windows controls were new in 5.2, and are improved
for Authorware 6. They allow you to use the
same type of objects you would see on a web-based
form or the dialogue boxes in Authorware itself.
You will often see Windows Controls abbreviated
to WinCtrls in Authorware documentation. This
is because the external functions used to create
them are contained in WinCtrls.u32, located
on your Authorware 5.2 or 6 CD.
One
advantage of using WinCtrls is that you can
set each control to reflect and set the value
of an Authorware variable. In other words, setting
the variable will instantly change the text
in the control, and typing into the control
will change the variable.
Probably
the easiest way to set up a WinCtrl is to use
the Windows Control Knowledge Object. Just drag
one to the flow line to get started.
If
you are only planning to have one control on
screen at a time, just use the default wcID
as the ID for your control. If you are planning
to have more than one, you'll need multiple
variables or a list variable to store the ID's
of several controls. Select "Edit" for the type.
Draw a box in the window for your WinCtrl, using
the boxes for Left, Top, Width, and Height to
adjust the size and location.
If
you want something to happen every time the
value of the control changes, leave the wcChageEvent
in place. If you have multiple WinCtrls, you
can choose to have one variable so that you
only need a single Conditional to respond to
the changes in all controls or you can use a
variable for each control. Keep in mind that
the variable you are about to "bind" to the
control will reflect its value at all times,
so you may not need to use this feature at all.
To
"bind" the control to its associated variable,
drag a "Windows Control - Set Property" KO onto
the Flow line and move "Variable Aware" from
the "Available properties" side to the "Selected
Properties" side. Change its value to True.
Next, move "Variable Name" from the "Available
properties" side to the "Selected Properties"
side. Type the name of the variable you want
to reflect the control's value. Make sure the
variable exists in your Authorware piece.
Now,
whenever a user types into the control, the value
of that variable will reflect whatever they typed,
whether they hit "Enter" or not. For information
on using WinCtrls without Knowledge Objects, see
"Using Windows Controls Knowledge Objects and
WinCtrls.u32 > Using Authorware Windows controls
variables > Coding a control" in your Auhtorware
6 Help Files. |