File: SWF%3A%3AButton.html

package info (click to toggle)
ming 1%3A0.4.3-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 27,236 kB
  • ctags: 11,055
  • sloc: ansic: 55,058; sh: 9,111; cpp: 3,752; yacc: 2,808; makefile: 2,155; python: 1,864; perl: 1,472; php: 678; tcl: 13
file content (196 lines) | stat: -rw-r--r-- 5,794 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SWF::Button - SWF button class</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:feedback@suse.de" />
</head>

<body style="background-color: white">


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#methods">METHODS</a></li>
	<li><a href="#author">AUTHOR</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
</ul>

<hr name="index" />
</div>
<!-- INDEX END -->

<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>SWF::Button - SWF button class</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
        use SWF::Button;
        $button = new SWF::Button();                                                                                                                                                                                      
        $button-&gt;setUp($shape1);  
        $button-&gt;setDown($shape2);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>Creates buttons for flash movies. Buttons are controlled by various
methods for visible design and triggered actions, see below:</p>
<p>
</p>
<hr />
<h1><a name="methods">METHODS</a></h1>
<dl>
<dt><strong><a name="button" class="item">new SWF::Button()</a></strong>

<dd>
<p>Creates a new Button object.</p>
</dd>
</li>
<dt><strong><a name="addshape" class="item">$button-&gt;addShape($shape, FLAG)</a></strong>

<dd>
<p>Adds $shape to the button. Using this method is not recommended, 
better use <a href="#addcharacter"><code>addCharacter()</code></a>, see next item for details.
Also unlike <a href="#addcharacter"><code>addCharacter()</code></a> this method does not return any SWF::ButtonRecord objects</p>
</dd>
</li>
<dt><strong><a name="addcharacter" class="item">$buttonrecord = $button-&gt;addCharacter($character [, $flags])</a></strong>

<dd>
<p>Adds character $shape to the button. Valid FLAGs are:</p>
</dd>
<dd>
<pre>
        SWFBUTTON_HIT
        SWFBUTTON_UP
        SWFBUTTON_DOWN
        SWFBUTTON_OVER</pre>
</dd>
<dd>
<p>Unlike <a href="#addshape"><code>addShape()</code></a> this method returns an object of SWF::ButtonRecord class.
The flag states can be combined using the binary or operator.</p>
</dd>
</li>
<dt><strong><a name="setover" class="item">$buttonrecord = $button-&gt;<code>setOver($shape)</code></a></strong>

<dd>
<p>Shortcut for $button-&gt;addCharacter($shape, SWFBUTTON_OVER);</p>
</dd>
</li>
<dt><strong><a name="sethit" class="item">$buttonrecord = $button-&gt;<code>setHit($shape)</code></a></strong>

<dd>
<p>Shortcut for $button-&gt;addCharacter($shape, SWFBUTTON_HIT);</p>
</dd>
</li>
<dt><strong><a name="setup" class="item">$buttonrecord = $button-&gt;<code>setUp($shape)</code></a></strong>

<dd>
<p>Shortcut for $button-&gt;addCharacter($shape, SWFBUTTON_UP);</p>
</dd>
</li>
<dt><strong><a name="setdown" class="item">$buttonrecord = $button-&gt;<code>setDown($shape)</code></a></strong>

<dd>
<p>Shortcut for $button-&gt;addCharacter($shape, SWFBUTTON_DOWN);</p>
</dd>
</li>
<dt><strong><a name="addaction" class="item">$button-&gt;addAction($action [,FLAG])</a></strong>

<dt><strong><a name="setaction" class="item">$button-&gt;setAction($action [,FLAG])</a></strong>

<dd>
<p>Adds $action object (see SWF::Action). Valid FLAGs are:</p>
</dd>
<dd>
<pre>
        SWFBUTTON_MOUSEUP
        SWFBUTTON_MOUSEOVER
        SWFBUTTON_MOUSEOUT
        SWFBUTTON_MOUSEDOWN
        SWFBUTTON_DRAGOVER
        SWFBUTTON_DRAGOUT</pre>
</dd>
<dd>
<p>SWFBUTTON_MOUSEUP is the default value of FLAG.</p>
</dd>
</li>
<dt><strong><a name="setmenu" class="item">$button-&gt;setMenu(0|1)</a></strong>

<dd>
<p>Parameter is 0 (off) or 1(on).
Can be used for a slight different behavior of buttons.</p>
</dd>
</li>
<dt><strong><a name="addsound" class="item">$soundinstance = $button-&gt;addSound($sound, $flags)</a></strong>

<dd>
<p>Plays a prepared SWF::Sound object and returns an object of SWF::SoundInstance.
Once more valid flags are:</p>
</dd>
<dd>
<pre>
        SWFBUTTON_MOUSEUP
        SWFBUTTON_MOUSEOVER
        SWFBUTTON_MOUSEOUT
        SWFBUTTON_MOUSEDOWN</pre>
</dd>
<dd>
<p>For example:</p>
</dd>
<dd>
<pre>
        $sound = new SWF::Sound(&quot;wow.mp3&quot;, SWF_SOUND_MP3_COMPRESSED );  
        $soundinstance = $button-&gt;addSound($sound, SWFBUTTON_MOUSEDOWN );</pre>
</dd>
</li>
<dt><strong><a name="setscalinggrid" class="item">$button-&gt;setScalingGrid($x, $y, $w, $h)</a></strong>

<dd>
<p>This function (available from SWF&gt;=8) sets a 9 slice scaling grid:
1 2 3 
4 5 6 
7 8 9
X, y, w and h define a rectangle, which is the dimension of the center slice
(5). All other slices are determined out of the characters bounds and the
defined rect. While slice 5 is scaled vertical and horizontal, slice 2 and 8
are only scaled horizontal. Slice 4 and 6 only vertical. The 4 corner slices
are not scaled (1, 3, 7, 9).</p>
</dd>
</li>
<dt><strong><a name="removescalinggrid" class="item">$button-&gt;<code>removeScalingGrid()</code></a></strong>

<dd>
<p>Removes scaling grid rectangles.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>wrapper written by</p>
<p>Soheil Seyfaie   (soheil at users dot sourceforge dot net)
Peter Liscovius (peterdd at users dot sourceforge dot net)
and many others.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p>SWF, SWF::Action, SWF::Shape, SWF::Movie, SWF::MovieClip, SWF::Constants, SWF::Sound, SWF::SoundInstance</p>

</body>

</html>