3 Creates the swf file PreLoaderTemplate.swf.
5 Part of the swftools package.
7 Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
30 int main (int argc,char ** argv)
37 S32 width = 826, height = 1169;
43 memset(&swf,0x00,sizeof(SWF)); // set global movie parameters
45 swf.fileVersion = 4; // make flash 4 compatible swf
46 swf.frameRate = 0x1900; // about 0x19 frames per second
48 swf.movieSize.xmax = 20*width; // flash units: 1 pixel = 20 units
49 swf.movieSize.ymax = 20*height;
51 swf.firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
58 tag = swf_InsertTag(tag,ST_DEFINESPRITE);
59 swf_SetU16(tag, 1); //id
60 swf_SetU16(tag, 0); //frames
61 tag = swf_InsertTag(tag,ST_END);
62 tag = swf_InsertTag(tag,ST_PLACEOBJECT2);
63 swf_ObjectPlace(tag, 1, 1, 0, 0, "loader");
65 tag = swf_InsertTag(tag,ST_SHOWFRAME);
67 a1 = action_PushFloat(0, 12.0);
68 a1 = action_PushString(a1, "");
69 a1 = action_GetProperty(a1);
70 a1 = action_PushFloat(a1, 2.0);
72 a1 = action_If(a1, 2);
73 a1 = action_GotoFrame(a1, 1);
79 tag = swf_InsertTag(tag,ST_DOACTION);
80 swf_ActionSet(tag, a1);
82 tag = swf_InsertTag(tag,ST_SHOWFRAME);
84 tag = swf_InsertTag(tag,ST_DOACTION);
85 swf_ActionSet(tag, a2);
87 tag = swf_InsertTag(tag,ST_REMOVEOBJECT2);
90 tag = swf_InsertTag(tag,ST_DEFINESPRITE);
91 swf_SetU16(tag, 2); //id
92 swf_SetU16(tag, 0); //frames
93 tag = swf_InsertTag(tag,ST_END);
94 tag = swf_InsertTag(tag,ST_PLACEOBJECT2);
95 swf_ObjectPlace(tag, 2, 2, 0, 0, "movie");
97 tag = swf_InsertTag(tag,ST_SHOWFRAME);
99 tag = swf_InsertTag(tag,ST_END);
101 f = open("PreLoaderTemplate.swf",O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0644);
102 if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n");
105 swf_FreeTags(&swf); // cleanup