1.::SWF::TextField(3) User Contributed Perl Documentation .::SWF::TextField(3)
2
3
4
6 SWF::TextField - SWF TextField class
7
9 use SWF::TextField;
10 $textfield = new SWF::TextField([$flags]);
11
13 Unlike SWF::Text objects, TextFields cannot be rotated, scaled non-
14 proportionally, or skewed. However, TextFields can be used as form
15 entries and they can use browser-defined fonts.
16
18 TextField is implemented into Flash since Flash3.
19 Most of features for TextFields are available since Flash4.
20 Simple HTML-tags in TextField are possible since Flash5.
21
23 new SWF::TextField([$flags]);
24 Creates a TextField object whose behaviour is dictated by "flags"
25 (see also SWF::Constants):
26
27 SWFTEXTFIELD_NOEDIT: Non-editable Textfiled
28 SWFTEXTFIELD_PASSWORD: Obscure user input with astricts.
29 SWFTEXTFIELD_DRAWBOX: Draw a border around TextField
30 SWFTEXTFIELD_MULTILINE: TextFiels may contain multiple lines
31 SWFTEXTFIELD_WORDWRAP: Warp text when text reaches TextField border
32 SWFTEXTFIELD_NOSELECT: TextField is not selected when user clicks on it
33 SWFTEXTFIELD_ALIGN_LEFT: Align text to the left
34 SWFTEXTFIELD_ALIGN_RIGHT: Align text to the right
35 SWFTEXTFIELD_ALIGN_CENTER: Align text to the center
36 SWFTEXTFIELD_ALIGN_JUSTIFY: Justify text
37 SWFTEXTFIELD_HTML: Add HTML markup string
38 SWFTEXTFIELD_HASLENGTH:
39 SWFTEXTFIELD_USEFONT: Want to embed font
40 SWFTEXTFIELD_AUTOSIZE:
41
42 Flags may be combined with the bitwise OR operation. For example:
43
44 my $t = new SWF::TextField(SWFTEXTFIELD_MULTILINE | SWFTEXTFIELD_WORDWRAP);
45
46 $textfield->addString($string)
47 $textfield->addUTF8String($UTF8string)
48 Add $string to TextField. Text is appended to the existing text.
49
50 $textfield->align($alignment)
51 $textfield->setAlignment($alignment)
52 Set the alignment of the text in the textfield. Possible values are
53
54 SWFTEXTFIELD_ALIGN_LEFT
55 SWFTEXTFIELD_ALIGN_RIGHT
56 SWFTEXTFIELD_ALIGN_CENTER
57 SWFTEXTFIELD_ALIGN_JUSTIFY
58
59 By default a SWF::TextField ist left aligned.
60
61 $textfield->setBounds($width, $height)
62 Sets the width and height of the textfield.
63
64 $textfield->setColor($red, $green, $blue [, $alpha])
65 Set the color of the text. An 8 bit value for each parameter. You
66 can use the hex or decimal notation. Even mixed.
67
68 $tf->setColor(0xcc,0,0x33);
69 $tf->setColor(204,0,51,255);
70
71 $textfield->setFont($font)
72 Sets an SWF::Font object -$font- to be used in the TextField.
73
74 $textfield->setPadding($padding)
75 Set TextField padding.
76
77 $textfield->setHeight($height)
78 Set the height of font in your textfield.
79
80 $textfield->setIndentation($indentation)
81 Set the indentation of the first line of a paragraph.
82
83 $textfield->setLeftMargin($left)
84 Sets the left margin of the textfield.
85
86 $textfield->setRightMargin($right)
87 Sets the right margin of the textfield.
88
89 $textfield->setMargins($left, $right)
90 Sets left and right margins of $textfield.
91
92 $textfield->setLineSpacing($linespacing)
93 Sets the space between lines.
94
95 $textfield->setName($name)
96 $textfield->setVariableName($name)
97 Assigns a name to the TextField which could be used to reference
98 the TextField within ActionScript.
99
100 $textfield->addChars($string)
101 $textfield->addUTF8Chars($UTF8string)
102 Adds characters to a font that will be available within a
103 textfield.
104
105 $textfield->setFlags($flags)
106 Set TextField behaviour by "flags" (see above new SWF::TextField)
107 For example:
108
109 $textfield->setFlags(SWFTEXTFIELD_PASSWORD);
110
111 $textfield->setLength($length)
112 Sets limit for user input size to $length.
113
114 $textfield->setFieldHeight($height)
115 Sets height limit for visible part of text field. If $height is set
116 to 0, the height is calculated by used font, see setHeight()
117 method.
118
120 Soheil Seyfaie (soheil at users.sourceforge.net).
121
123 SWF, SWF::Action, SWF::Button, SWF::Constants, SWF::DisplayItem,
124 SWF::Font, SWF::Movie, SWF::MovieCip, SWF::Text
125
126
127
128perl v5.30.0 2019-10-02 .::SWF::TextField(3)