Description
new
swfbutton
( void)
swfbutton(
)
crée
un
nouveau
bouton
.
Cliquez-le
,
passez
la
souris
dessus
,
et
appelez
des
actions
.
Facile
!
SWFButton
a
les
méthodes
suivantes
:
swfbutton
-
addshape(
)
,
swfbutton
-
setup(
)
,
swfbutton
-
setover(
)
swfbutton
-
setdown(
)
,
swfbutton
-
sethit(
)
swfbutton
-
setaction(
)
et
swfbutton
-
addaction(
)
.
Cet
exemple
simplissime
vous
montre
comme
faire
un
roll-over
,
un
roll-on
,
un
clic
,
un
relaché
de
souris
,
et
rien
du
tout
(
pas
d'action
)
.
Exemple
1
.
Exemple
avec
swfbutton(
)
|
Cet
exemple
simple
illustre
le
déplacement
d
'
un
gros
bouton
rouge
dans
la
fenêtre
.
Ce
n
'
est
pas
du
tirer-déposer
,
mais
juste
du
tirer
.
Exemple
2
.
Exemple
avec
swfbutton
-
addaction(
)
?php
$s
=
new
SWFShape(
)
;
$s
-
setRightFill($s
-
addFill(0xff
,
0
,
0))
;
$s
-
drawLine(1000,0)
;
$s
-
drawLine(0,1000)
;
$s
-
drawLine(-1000,0)
;
$s
-
drawLine(0,-1000)
;
$b
=
new
SWFButton()
;
$b
-
addShape($s
,
SWFBUTTON_HIT
|
SWFBUTTON_UP
|
SWFBUTTON_DOWN
|
SWFBUTTON_OVER)
;
$b
-
addAction(new
SWFAction("startDrag('
/
test'
,
0)
;")
,
SWFBUTTON_MOUSEDOWN)
;
/
/
'0
'
signifie
:
ne
pas
verrouiller
la
souris
$b
-
addAction(new
SWFAction("stopDrag()
;")
,
SWFBUTTON_MOUSEUP
|
SWFBUTTON_MOUSEUPOUTSIDE)
;
$p
=
new
SWFSprite()
;
$p
-
add($b)
;
$p
-
nextFrame()
;
$m
=
new
SWFMovie()
;
$i
=
$m
-
add($p)
;
$i
-
setName('test')
;
$i
-
moveTo(1000,1000)
;
header('Content-type
:
application
/
x-shockwave-flash')
;
$m
-
output()
;
?
|
|