3 Creates the swf file PreLoaderTemplate.swf.
5 Part of the swftools package.
7 Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
9 This file is distributed under the GPL, see file COPYING for details
19 int main (int argc,char ** argv)
26 S32 width = 826, height = 1169;
32 memset(&swf,0x00,sizeof(SWF)); // set global movie parameters
34 swf.fileVersion = 4; // make flash 4 compatible swf
35 swf.frameRate = 0x1900; // about 0x19 frames per second
37 swf.movieSize.xmax = 20*width; // flash units: 1 pixel = 20 units
38 swf.movieSize.ymax = 20*height;
40 swf.firstTag = swf_InsertTag(NULL,ST_SETBACKGROUNDCOLOR);
47 tag = swf_InsertTag(tag,ST_DEFINESPRITE);
48 swf_SetU16(tag, 1); //id
49 swf_SetU16(tag, 0); //frames
50 tag = swf_InsertTag(tag,ST_END);
51 tag = swf_InsertTag(tag,ST_PLACEOBJECT2);
52 swf_ObjectPlace(tag, 1, 1, 0, 0, "loader");
54 tag = swf_InsertTag(tag,ST_SHOWFRAME);
56 a1 = action_PushFloat(0, 12.0);
57 a1 = action_PushString(a1, "");
58 a1 = action_GetProperty(a1);
59 a1 = action_PushFloat(a1, 2.0);
61 a1 = action_If(a1, 2);
62 a1 = action_GotoFrame(a1, 1);
68 tag = swf_InsertTag(tag,ST_DOACTION);
69 swf_ActionSet(tag, a1);
71 tag = swf_InsertTag(tag,ST_SHOWFRAME);
73 tag = swf_InsertTag(tag,ST_DOACTION);
74 swf_ActionSet(tag, a2);
76 tag = swf_InsertTag(tag,ST_REMOVEOBJECT2);
79 tag = swf_InsertTag(tag,ST_DEFINESPRITE);
80 swf_SetU16(tag, 2); //id
81 swf_SetU16(tag, 0); //frames
82 tag = swf_InsertTag(tag,ST_END);
83 tag = swf_InsertTag(tag,ST_PLACEOBJECT2);
84 swf_ObjectPlace(tag, 2, 2, 0, 0, "movie");
86 tag = swf_InsertTag(tag,ST_SHOWFRAME);
88 tag = swf_InsertTag(tag,ST_END);
90 f = open("PreLoaderTemplate.swf",O_WRONLY|O_CREAT|O_TRUNC, 0644);
91 if FAILED(swf_WriteSWF(f,&swf)) fprintf(stderr,"WriteSWF() failed.\n");
94 swf_FreeTags(&swf); // cleanup