From: kramm Date: Fri, 7 Feb 2003 15:44:41 +0000 (+0000) Subject: swfc manual- initial revision. X-Git-Tag: release-0-4-4~111 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=c2b431306dc202edd5c7d59cc8ddb784fe66caeb swfc manual- initial revision. --- diff --git a/doc/Courier.swf b/doc/Courier.swf new file mode 100644 index 0000000..561b361 Binary files /dev/null and b/doc/Courier.swf differ diff --git a/doc/Helvetica.swf b/doc/Helvetica.swf new file mode 100644 index 0000000..d35c4fc Binary files /dev/null and b/doc/Helvetica.swf differ diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 0000000..8c9a2b9 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,3 @@ +all: + xsltproc guide.xsl swfc.xml > tmp.html + perl codebeautifier.pl < tmp.html > swfc.html diff --git a/doc/Scenery50.swf b/doc/Scenery50.swf new file mode 100755 index 0000000..977a592 Binary files /dev/null and b/doc/Scenery50.swf differ diff --git a/doc/caiviar.css b/doc/caiviar.css new file mode 100644 index 0000000..9beec12 --- /dev/null +++ b/doc/caiviar.css @@ -0,0 +1,343 @@ +BODY { + color: black; + font-family: Verdana, Arial, Helvetica; + font-size: 1.0em; +} + +.dochead { + margin-top: 1.5em; + font-size: 1.7em; + font-weight: bold; + color: #000000; +} + +.chaphead { +/* margin: 1.2em 14% 0.5em 3%; */ + font-size: 1.3em; + font-weight: bold; + color: #0000ff; +} + +.chapnum { + font-size: 0.8em; + font-weight: bold; + color: #0000ff; +} + +.secthead { +/* margin: 1.0em 14% 0.2em 4%;*/ +/* My suggested new color and size, to take the new subsections (level 3) into account. + color: #2545ee; + font-size: 1.1em;*/ + color: #2020ff; + font-size: 1.4em; + font-weight: bold; + font-family: Verdana, Arial, Helvetica; + /*text-decoration: underline;*/ +} + +.subsecthead { +/* margin: 1.0em 14% 0.2em 4%;*/ + color: #6c6cff; + font-size: 1.2em; + font-weight: bold; + font-family: Verdana, Arial, Helvetica; +/* text-decoration: underline; */ +} + +.subsubsecthead { +/* margin: 1.0em 14% 0.2em 4%;*/ + color: #303030; + font-size: 1.0em; + font-weight: bold; + font-family: Verdana, Arial, Helvetica; +/* text-decoration: underline; */ +} + +a.highlight:link { color: #00ff00; text-decoration: none; } +a.highlight:visited { color: #00ff00; text-decoration: none; } +a.highlight:hover { color: #00ff00; text-decoration: underline; } +a.highlight:active { color: #00ff00; text-decoration: underline; } + +a.menulink:link { color: #a0a0d0; text-decoration: none; } +a.menulink:visited { color: #a0a0d0; text-decoration: none; } +a.menulink:hover { color: #00ff00; text-decoration: underline; } +a.menulink:active { color: #00ff00; text-decoration: underline; } + +a.oldlink:link { color: #9090c0; text-decoration: none; } +a.oldlink:visited { color: #9090c0; text-decoration: none; } +a.oldlink:hover { color: #00ff00; text-decoration: underline; } +a.oldlink:active { color: #00ff00; text-decoration: underline; } + +a.altlink:link { color: #7a5ada; text-decoration: none; } +a.altlink:visited { color: #5a3aba; text-decoration: none; } +a.altlink:hover { color: #7a5ada; text-decoration: underline; } +a.altlink:active { color: #7a5ada; text-decoration: underline; } + + +.menu { + font-size: 0.75em; + font-weight: bold; + font-family: Verdana, Arial, Helvetica; + color: #cccccc; + padding-left: 1.0em; + padding-right: 1.0em; + padding-top: 0.5em; + padding-bottom: 0.75em; +} + +.altmenu { + font-size: 0.65em; + font-weight: bold; + font-family: Verdana, Arial, Helvetica; + color: #000000; + padding-left: 1.0em; + padding-right: 1.0em; +} + +.alttext { + font-size: 0.65em; + font-family: Verdana, Arial, Helvetica; + color: #000000; +/* padding-left: 1.0em; + padding-right: 1.0em;*/ +} + +.infotab { + padding: 0.5em; + margin-top: 1.0em; + margin-left: 1.0em; + margin-bottom: 1.0em; +} + +.infohead { + font-size: 0.7em; + font-family: Verdana, Arial, Helvetica; + padding-top: 0.2em; + padding-bottom: 0.2em; + padding-left: 1.0em; + margin-left: 1.0em; + color: #ffffff; + font-weight: bold; +} + +.infosub { + margin-top: 0.25em; + margin-bottom: 0.15em; + margin-left: 0em; + margin-right: 0.5em; + padding: 0em; + font-weight: bold; +} + +.infolist { + margin-top: 0.05em; + margin-bottom: 0.05em; + margin-left: 1.0em; + margin-right: 0.5em; + padding: 0em; + padding-top: 0.3em; +} + +.infogfx { + padding: 0em; +} + +.infotext { + font-size: 0.7em; + font-family: Verdana, Arial, Helvetica; + color: #320f61; + margin-left: 1.5em; + margin-right: 1.5em; +} +/* +.chaphead { + margin: 1.2em 14% 0.5em 3%; + font-size: 1.6em; + font-weight: bold; +} +*/ +.copyright { + padding-left: 1.0em; + padding-right: 1.0em; + margin: 0em 0% 0.2em 0%; + font-size: 0.7em; + font-family: Verdana, Arial, Helvetica; + text-align: right; + color: #808080; +} + +.copyright:link { + text-decoration: underline; + color: #808080; +} + +.copyright:visited { + text-decoration: underline; + color: #808080; +} + +.copyright:hover { + text-decoration: underline; + color: #0000ff; + +} + +.subhead { + font-family: Verdana, Arial, Helvetica; + font-size: 1.2em; + font-weight: bold; + /*margin: 0.5em 0% 0.5em 0%;*/ +} + +.content { + /*padding: 3em;*/ + padding-top: 0em; + padding-left: 1.0em; + padding-right: 1.0em; + font-family: Verdana, Arial, Helvetica; + font-size: 0.8em; +} + +.ntable { + padding: 0em; + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +.itable { + padding: 0em; + margin-top: 0.0em; + margin-bottom: 0.0em; +} + +.ncontent { + /*content with no padding, for an ugly Netscape 4.7 compatibility hack*/ + padding: 0em; + margin-top: 0.5em; + margin-bottom: 0.5em; + font-family: Verdana, Arial, Helvetica; + font-size: 0.8em; +} + +PRE { + padding: 0.5em; + font-family: Lucida Console, Courier; + color: #000000; + font-size: 0.75em; +} + +.input { + color: #0000ff; +} + +.comment { + color: #ff0000; +} + +.code { + font-family: Lucida Console, Courier; + color: #0000ff; + font-size: 0.9em; +} + +.path { + font-family: Lucida Console, Courier; + /*color: #008060; */ + font-size: 0.9em; + font-weight: bold; +} + +.emphasis { + font-style: italic; +} + +.brite { + color: #ff0000; +} + +P.note { + padding: 0.5em; +} + +P.impo { + padding: 0.5em; +} + +P.warn { + padding: 0.5em; +} + +.contentbox { + margin-left: 5%; + margin-right: 5%; + margin-top: 2%; + margin-bottom: 2%; + padding: 0.8em; +} + +.logobg { + background: #45347b; +} + +.top { + background: black; + font-family: Verdana, Arial, Helvetica; + font-size: 0.8em; + color: #c0c0c0; + padding: 0em; + margin: 0em; +} + +.topnews { + background: #5f4e4e; + color: white; +} + +.tophead { + color: #a7f3fe; + font-weight: bold; + margin: 0em; +} + +.tableinfo { + padding-left: 1.0em; + padding-right: 1.0em; + font-size: 0.7em; + background: #dddddd; + font-weight: bold; + font-family: Verdana, Arial, Helvetica; +} + +.toptext { + color: #ffffff; + margin-bottom: 7px; +} +.toptext a:hover { + color: #00ff00; +} + +.toptext a:link { + font-style: normal; + color: #00dd00; +} + +.bartext { + color: #6c6cff; + font-family: Verdana, Arial, Helvetica; + font-size: 0.8em; + padding: 0em; +} +.docs-index { + margin: 0em; + margin-left: 20px; + font-family: Verdana, Arial, Helvetica; + line-height: 1.25em; + border: 3px white solid; +} +/*this works fine in IE, but not in any other browser!, yet it's perfectly valid */ +.docs-index .emphasis { + font-style: normal; + font-weight: bold; +} + diff --git a/doc/codebeautifier.pl b/doc/codebeautifier.pl new file mode 100644 index 0000000..094c523 --- /dev/null +++ b/doc/codebeautifier.pl @@ -0,0 +1,37 @@ +while() +{ + if(/\[CALLPERL .*left\]/ ... /\[CALLPERL end\]/) { + $code .= $_ if(!/CALLPERL/); + $name = $1 if(/.swf.*name=([^&][^ ]*)/); + $name = $1 if(/.swf.*name="([^&]*)"/); + } + elsif(/\[CALLPERL .*right\]/ ... /\[CALLPERL end\]/) { + $highlight .= $_ if(!/CALLPERL/); + } + elsif ($code ne "") { + $code =~ s/"/"/g; + open(fi, ">tmp.sc");print fi $code;close(fi); + system("swfc tmp.sc"); + ($embed = `swfdump -e $name`) =~ /WIDTH="([^"]*)"/; + $width = $1; + print ""; + print $embed; + print ""; + $code=""; + print; + unlink "tmp.sc"; + } + elsif ($highlight ne "") { + $highlight =~ s/^\n\s*//g; + $highlight =~ s/\s*\n$//g; + print "
\n";
+	# todo: apply syntax highlighting.
+	print $highlight."\n";
+	print "
\n"; + $highlight=""; + print; + } + else { + print; + } +} diff --git a/doc/guide.xsl b/doc/guide.xsl new file mode 100644 index 0000000..512cc1e --- /dev/null +++ b/doc/guide.xsl @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + <xsl:value-of select="title"/> + + + + + + + + + + + + + + + + +
+

+ + + + + +

+
+ line +
Summary: 
+ line +
+ + + + +
+ + + + + + + + + + + +

+ + . + + +

+
+ +

+ + . + +

+
+
+ + + +
+ + + + + +

+ .  +   +

+
+ + + + +
+ + + + + + +

+ ..  +   +

+
+ + + + + +
+ + + + + + + +

+ ...  +   +

+
+ + + + + + +
+ + + + + + + doc_chap_fig +
+ + + + + + + + +
+

+ + + Figure .: + + + Figure . + + +

+
+ + + Fig. {$fignum}: {@short} + + + Fig. {$fignum} + + +
+
+
+ + + +
+ + + + {@short} + + + + {@short} + + +
+ + + +
+
+ + + + + + +
+

+ Note: + +

+
+
+ + + + + + +
+

+ Important: + +

+
+
+ + + + + + +
+

+ Warning: + +

+
+
+ + + // + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ +

+
+ + + + + + +
+
+	    
+	  
+
+
+
+ + + + + + + + + + +
+ + +
+
+ + + + + + + doc_chap_pre + + + + + + + + +[CALLPERL left] + +[CALLPERL end] + + + + +
+

+ + + Code listing .: + + + Code listing . + + +

+
+ +[CALLPERL right] + +[CALLPERL end] +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ + + +

+
+ +

+ + + +

+
+
+
+ + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + +
    + +
+
+ + +
    + +
+
+ + +
  • + +
  • +
    + + +
    diff --git a/doc/photo.swf b/doc/photo.swf new file mode 100644 index 0000000..745603a Binary files /dev/null and b/doc/photo.swf differ diff --git a/doc/swfc.xml b/doc/swfc.xml new file mode 100644 index 0000000..bd1176e --- /dev/null +++ b/doc/swfc.xml @@ -0,0 +1,187 @@ + + + +SWFC Manual + + +swfc is a tool for generating flash files. You can write small simple scripts +and then have them compiled to SWF Flash Animations. + + + + + +swfc Basics + +
    Calling swfc + +

    + + swfc is command line based. You call it via + + $ swfc file.sc + + The filename of what is generated depends on the filename of the script (file.sc), + the filename given inside the script, and the optional -o passed to swfc. + +

    + + + Though swfc is a command-line utility, there also exists a nice graphical + frontend for it, called Swifty. + + +
    + +
    A simple swfc example + +

    + Let's create simple SWF file, shall we? + The following script creates a red box with a yellow border. On the right side you + see the script used, on the left side the swf file that is generated. +

    + + +.swf name="box.swf" + .box b1 100 100 color=yellow fill=red + .put b1 pin=center scale=0% + .frame 100 + .change b1 pin=center scale=100% + .frame 200 + .change b1 pin=center scale=0% +.end + + + The .box command creates the box. Every object that is created must also be explicitly + put into the scene using .put to become visible. + +
    + +
    Text generation + + +.swf name="text5.swf" +.font courier "Courier.swf" +.font helvetica "Helvetica.swf" +.text hithere text="HELLO" font=courier size=50% color=blue +.shape scene Scenery50.swf + +.frame 0 + .startclip hithere pin=center x=100 y=75 scale=50% #text clips... + .put scene # ...the image "scene" + .end +.frame 100 + .change hithere rotate+=360 pin=center scale=100% + +.end + + + +.swf name="text6.swf" +.font courier "Courier.swf" +.font helvetica "Helvetica.swf" +.text hello text="HELLO" font=helvetica size=50% color=blue +.text world text="WORLD" font=helvetica size=50% color=red + +.frame 0 + .put hello pin=center x=50 y=50 + .put world pin=center x=50 y=50 alpha=25% +.frame 200 + .change hello rotate+=360 pin=center alpha=25% + .change world rotate-=360 pin=center alpha=100% +.end + + +
    + +
    Color transforms + + +.swf name="cxform.swf" version=5 + + .shape s1 "photo.swf" + + .put s1 x=50 y=50 scalex=110 scaley=110 + .frame 100 + .change s1 x=0 y=0 scalex=210 scaley=210 red=-1+255 green=-1+255 blue=-1+255 #invert + .frame 200 + .change s1 x=100 y=50 scalex=110 scaley=110 red=0 green=+0 blue=+0 #remove red + .frame 300 + .change s1 x=0 y=0 scalex=210 scaley=210 red=+0 green=2 blue=-1+255 #amplify green, invert blue + .frame 400 + .change s1 x=50 y=100 scalex=110 scaley=110 red=2-128 green=-2+255 blue=+0.7+40 #alien glow + .frame 500 + .change s1 x=0 y=0 scalex=210 scaley=210 red=8-1024 green=8-1024 blue=8-1024 #palette reduce + .frame 600 + .change s1 x=0 y=0 scalex=210 scaley=210 red=+0 green=+0 blue=+0 #back to normal + .frame 700 + .change s1 x=105 y=105 scalex=0 scaley=0 luminance=0 #fadeout +.end + + +
    + + +
    +