forked from php/php-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
testswf
120 lines (104 loc) · 2.26 KB
/
testswf
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
<?php
$LINEID=1;
$LINEDEPTH=50;
$LINESTEPS=30;
$CIRCLEID=2;
$CIRCLEDEPT=100;
/* stop playing */
function stop()
{
swf_startdoaction();
swf_actionStop();
swf_enddoaction();
}
/* play stoping */
function play()
{
swf_startdoaction();
swf_actionPlay();
swf_enddoaction();
}
/*
* demonstrates:
* defining and placing an object.
*
*/
function flipline()
{
global $LINESTEPS, $LINEID, $LINEDEPTH;
swf_ortho2(-100.0,100.0,-100.0,100.0);
swf_defineline($LINEID,-60.0,0.0,60.0,0.0,1.2);
swf_mulcolor(1.0,1.0,1.0,1.0);
swf_addcolor(0.0,0.0,0.0,0.0);
for($i=0; $i<$LINESTEPS; $i++) {
$p = $i/($LINESTEPS-1.0);
swf_pushmatrix();
swf_rotate(60.0*$p,'z');
swf_translate(20.0+20.0*$p,0.0,0.0);
swf_rotate(120.0*$p,'z');
swf_placeobject($LINEID, $LINEDEPTH);
swf_popmatrix();
swf_showframe();
}
for($i=0; $i<$LINESTEPS; $i++) {
swf_removeobject($LINEDEPTH);
if(($i%4) == 0)
swf_showframe();
}
swf_showframe();
}
/* growblobs follows */
$NBLOBS=8;
$BLOBSTEPS=20;
/*
* demonstrates:
* shape definition
* placing, and modifying objects.
*
*/
function growblobs()
{
global $NBLOBS, $BLOBSTEPS, $CIRCLEDEPT, $CIRCLEID;
swf_ortho2(-200.0,200.0,-200.0,200.0);
swf_startshape($CIRCLEID);
swf_shapefillsolid(0.0,0.0,0.0,1.0);
swf_shapearc(0.0,0.0,300.0,0.0,360.0);
swf_endshape();
swf_mulcolor(1.0,1.0,1.0,1.0);
$startframe = swf_getframe();
for($j=0; $j<$NBLOBS; $j++) {
swf_setframe($startframe+2*$j);
for($i=0; $i<$BLOBSTEPS; $i++) {
$p = $i/($BLOBSTEPS-1.0);
swf_pushmatrix();
swf_scale($p,$p,$p);
swf_addcolor($p,$p,$p,0.0);
if($i== 0)
swf_placeobject($CIRCLEID,$CIRCLEDEPTH+$j);
else
swf_modifyobject($CIRCLEDEPTH+$j,MOD_COLOR|MOD_MATRIX);
swf_popmatrix();
swf_showframe();
}
swf_removeobject($CIRCLEDEPTH+$j);
}
swf_showframe();
}
swf_openfile("test.swf",400.0,400.0,20.0,1.0,1.0,1.0);
flipline();
growblobs();
// trytext();
// makebuttons();
// stop();
swf_showframe();
swf_closefile();
// swf_openfile("images.swf",400.0,400.0,20.0,1.0,1.0,1.0);
// showimages();
// brushstrokes();
// symboltest();
// stop();
// swf_showframe();
// swf_closefile();
// fprintf(stderr,"wrote images.swf\n");
exit(0);
?>