SWFTextField

Text Fields are less flexible than Text objects- they can't be rotated, scaled non-proportionally, or skewed, but they can be used as form entries, and they can use browser-defined fonts.


$t = new SWFTextField([$flags]);
t = SWFTextField([flags])
SWFText *t = new SWFTextField([flags]);
SWFText t = newSWFTextField(flags);

Create a new text field object.

The optional flags change the text field's behavior:

SWFTEXTFIELD_NOEDIT indicates that the field shouldn't be user-editable
SWFTEXTFIELD_PASSWORD obscures the data entry
SWFTEXTFIELD_DRAWBOX draws the outline of the textfield
SWFTEXTFIELD_MULTILINE allows multiple lines
SWFTEXTFIELD_WORDWRAP allows text to wrap
SWFTEXTFIELD_NOSELECT makes the field non-selectable
Flags are combined with the bitwise OR operation. For example,
$t = newSWFTextField(SWFTEXTFIELD_PASSWORD | SWFTEXTFIELD_NOEDIT);
creates a totally useless non-editable password field.


$t->setFont($font);
t.setFont(font)
t->setFont(font);
SWFTextField_setFont(t, font);
Set the text field font to the [browser-defined?] font font.


$t->setBounds($width, $height);
t.setBounds(width, height)
t->setBounds(width, height);
SWFTextField_setBounds(t, width, height);
Set the text field width and height. If you don't set the bounds yourself, Ming makes a poor guess at what the bounds are.


$t->align($alignment);
t.align(alignment)
t->align(alignment);
SWFTextField_align(t, alignment);
Set the text field alignment. Legit values are:
SWFTEXTFIELD_ALIGN_LEFT
SWFTEXTFIELD_ALIGN_RIGHT
SWFTEXTFIELD_ALIGN_CENTER
SWFTEXTFIELD_ALIGN_JUSTIFY


$t->setHeight($height);
t.setHeight(height)
t->setHeight(height);
SWFTextField_setHeight(t, height);
Set the font height of this text field font to the given height. Default is 240.


$t->setLeftMargin($width);
t.setLeftMargin(width)
t->setLeftMargin(width);
SWFTextField_setLeftMargin(t, width);
Set the left margin width of the text field. Default is 0.


$t->setRightMargin($width);
t.setRightMargin(width)
t->setRightMargin(width);
SWFTextField_setRightMargin(t, width);
Set the right margin width of the text field. Default is 0.


$t->setMargins($left, $right);
t.setMargins(left, right)
t->setMargins(left, right);
SWFTextField_setMargins(t, left, right);
Set both margins at once, for the man on the go.


$t->setIndentation($width);
t.setIndentation(width)
t->setIndentation(width);
SWFTextField_setIndentation(t, width);
Set the indentation of the first line in the text field.


$t->setLineSpacing($height);
t.setLineSpacing(height)
t->setLineSpacing(height);
SWFTextField_setLineSpacing(t, height);
Set the line spacing of the text field. Default is 40.


$t->setColor($r, $g, $b [, $a]);
t.setColor(r, g, b [, a])
t->setColor(r, g, b [, a]);
SWFTextField_setColor(t, r, g, b, a);
Set the color of the text field. Default is fully opaque black.


$t->setName($name);
t.setName(name)
t->setName(name);
SWFTextField_setName(t, name);
Set the variable name of this text field, for form posting and action scripting purposes.


$t->addString($string);
t.addString(string)
t->addString(string);
SWFTextField_addString(t, string);
Concatenate the given string to the text field.


Example code

back to index


All content Copyright (C) 2000-2002 Opaque Industries except where noted otherwise.