X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=doc%2Ffileformat.sc;h=752426cd70070c0cd7e00610205ac7576cf9583a;hb=5f8164451a5c4401126a7118df0b4561346d276f;hp=779fa6876458049ec186b5f722f4bce56e598ddb;hpb=863160b762abe3fa57cd3120da883281e011d0be;p=swftools.git diff --git a/doc/fileformat.sc b/doc/fileformat.sc index 779fa68..752426c 100644 --- a/doc/fileformat.sc +++ b/doc/fileformat.sc @@ -1,18 +1,18 @@ # ================================================================================== # -# File format specification (well, sort of) +# swfc(1) File format specification (well, sort of) # Version: 0.1 # # ================================================================================== # Notice that the following is actually a valid .sc file, generating the four swfs -# spec.swf, scroll1.swf, scroll2.swf and simple_viewer.swf. (Provided all included +# spec.flash, scroll1.flash, scroll2.flash and simple_viewer.flash. (Provided all included # files are present) # File header # ----------- -.swf bbox=200x200 version=6 fps=50 name="spec.swf" compress +.flash bbox=200x200 version=6 fps=50 name="spec.swf" compress # bbox=200x200 : set bounding box to 200x200 # bbox=200x200:100:100 : set bounding box to (100,100)-(300,300) @@ -22,17 +22,17 @@ # # version=6 : generate flash mx movie # fps=50 : set framerate to 50 frames/second -# name="..." : save result to spec.swf. (Default: input file with extension -# changed to .swf, or the value of the -o command line +# name="..." : save result to spec.flash. (Default: input file with extension +# changed to .flash, or the value of the -o command line # parameter if given) # load a simple object: # --------------------- -.shape myshape1 "choo1.swf" -.shape myshape2 filename="choo1.swf" # long form -.shape myshape3 filename=choo1.swf # long form, without quotes -.shape myshape4 choo1.swf # short form, without quotes +.swf myshape1 "choo1.swf" +.swf myshape2 filename="choo1.swf" # long form +.swf myshape3 filename=choo1.swf # long form, without quotes +.swf myshape4 choo1.swf # short form, without quotes #TODO: Do those files come from the current directory, the script directory or both? @@ -51,6 +51,15 @@ .texture text1=background scale=50% rotate=45 +# define a gradient +# ----------------- + +#.gradient mygradient: +# 0.000 0 0 0 +# 0.500 255 255 255 +# 1.000 0 0 0 +#.end + # load several pages: # ------------------- @@ -97,6 +106,10 @@ # Sound effects on user pressing or releasing a button .button playbutton shape=obj1 + onMouseDown: { + } + onMouseUp: { + } # ... .end .buttonsounds playbutton press=sound1 release=sound2 enter=sound3 leave=sound4 @@ -143,7 +156,7 @@ # interpolation between crude manual animation frames # --------------------------------------------------- -.shape ball "ball.fig" #The ball should be white or violet to make the cxforms below work +.swf ball "ball.fig" #The ball should be white or violet to make the cxforms below work # now draw two balls, which fly around each other. @@ -237,7 +250,7 @@ # clipping an animation inside a star-shaped sprite: -.shape mystar1 "star.swf" +.swf mystar1 "star.swf" .movie anim1 "penguins.swf" .sprite cspr1 @@ -336,14 +349,14 @@ #simplified: -.action +.action: stop spr1 setproperty spr1._visible 1 #TODO: spr1._visible=1? .end #full: -.action opcodes +.action opcodes: settarget "spr1" stop settarget "" @@ -356,14 +369,14 @@ #simplified: -.button playbutton2 shape=obj1 opcodes +.button playbutton2 shape=obj1 opcodes: press: play spr1 release: stop spr1 .end #full: -.button playbutton3 shape=obj1 opcodes +.button playbutton3 shape=obj1 opcodes: press: settarget "spr1" play @@ -418,7 +431,7 @@ # a background image # -.swf bbox=200x200 fps=25 version=6 name="scroll1.swf" +.flash bbox=200x200 fps=25 version=6 name="scroll1.swf" .jpeg background "panorama.jpg" @@ -451,7 +464,7 @@ # This example now also fades the text in and out again # -.swf bbox=200x200 fps=25 version=6 name="scroll2.swf" +.flash bbox=200x200 fps=25 version=6 name="scroll2.swf" .jpeg background "panorama.jpg" #create some text for a title and credits @@ -472,12 +485,12 @@ # simpleviewer.sc # -# Create the simple_viewer.swf file used in SWFTools. +# Create the simple_viewer.flash file used in SWFTools. -.swf bbox=1024x768 version=4 fps=25 name="simple_viewer.swf" +.flash bbox=1024x768 version=4 fps=25 name="simple_viewer.swf" .frame 1 -.shape leftshape "left.fig" -.shape rightshape "right.fig" +.swf leftshape "left.fig" +.swf rightshape "right.fig" .sprite viewport .end @@ -516,7 +529,7 @@ # boxlayers.sc # test "above" -.swf bbox=400x300 version=4 fps=50 name="boxLayers.swf" +.flash bbox=400x300 version=4 fps=50 name="boxLayers.swf" .box box1 width=100 height=100 color=white fill .box box2 width=100 height=100 color=white fill @@ -537,7 +550,7 @@ # # Do things with rectangles. -.swf bbox=autocrop version=6 fps=50 name="boxes.swf" compress +.flash bbox=autocrop version=6 fps=50 name="boxes.swf" compress .box box1 width=100 height=100 color=red fill #filled red box .box box2 width=100 height=100 color=white #white hollow frame @@ -560,10 +573,10 @@ # monkey.sc # -.swf bbox=autocrop version=4 fps=50 name="monkey.swf" +.flash bbox=autocrop version=4 fps=50 name="monkey.swf" - .shape island "island.swf" - .shape monkey "monkey4.swf" + .swf island "island.swf" + .swf monkey "monkey4.swf" .put island .point leftfoot 45 177 .point rightfoot 138 177 @@ -588,9 +601,9 @@ # # Try color transforms -.swf name="cxform.swf" version=5 +.flash name="cxform.swf" version=5 - .shape s1 "photo.swf" + .swf s1 "photo.swf" .put s1 x=50 y=50 scalex=110 scaley=110 .frame 100 @@ -613,7 +626,7 @@ # # Test transparency -.swf bbox=200x200 version=5 fps=25 name="transparency.swf" +.flash bbox=200x200 version=5 fps=25 name="transparency.swf" .box box1 90 90 color=yellow fill=blue line=5 .box box2 90 90 color=white fill=red line=5 @@ -636,7 +649,7 @@ # # Test points, pivots, pins -.swf version=5 fps=20 name="points.swf" +.flash version=5 fps=20 name="points.swf" .box box 90 90 color=white fill=red line=5 .point center 45 45 @@ -668,7 +681,7 @@ # # Test clipping -.swf name="clip.swf" fps=25 +.flash name="clip.swf" fps=25 .sprite s1 # this just constructs a colorful object "s1" .box b1 40 40 color=red fill=violet line=10 .box b2 40 40 color=blue fill=green line=10 @@ -694,7 +707,11 @@ .end -.swf name="fonts.swf" +# fonts.sc +# +# fonts&text + +.flash name="fonts.swf" .font courier "Courier.swf" .font helvetica "Helvetica.swf" .text abc text="abcdefghijklmnopqrstuvwxyz" font=courier size=100% color=blue @@ -708,7 +725,7 @@ # # Shearing -.swf bbox=300x200:-30 name="shear.swf" fps=25 +.flash bbox=300x200:-30 name="shear.swf" fps=25 .font helvetica "Helvetica.swf" .text text text="Shear" font=helvetica size=100% color=yellow .put t0=text y=150 alpha=0% shear=0 @@ -748,3 +765,90 @@ .change t9 alpha=0% shear=-0 .end +# sound.sc +# +# Sound effects + +.flash name="sound.swf" fps=25 +.sound loco "LocoStart.wav" +.sound whistle "Whistle.wav" + +.frame 0 + .play loco +.frame 25 + .stop loco + .play whistle loop=20 +.frame 200 + .stop whistle +.end + + +# outline.sc +# +# Outlines /Fillings + +.flash name="outline.swf" + + .outline box: + moveTo 0,0 + lineTo 100,0 + lineTo 100,100 + lineTo 0,100 + lineTo 0,0 + .end + + .font arial "Arial.swf" + + .textshape abc font="arial" text="Hello World" + +# .gradient bluegreen: +# 0% blue +# 50% green +# 100% red +# .end + + .filled fabc outline=box fill=#ff6633 line=5 color=#7799ff + .filled fbox outline=abc fill=#ff6633 line=5 color=#7799ff + + .put fabc + .put fbox y=200 +.end + +# gradients +.flash name="gradient.swf" + + .font arial "Arial.swf" + .textshape abc font="arial" text="Hello World" + + .gradient bluegreen: + 0% blue + 50% green + 100% red + .end + + .gradient sunshine radial: + 0% white + 50% yellow + 100% red + .end + + .filled fbox outline=abc fill=bluegreen line=1 color=#7799ff + .filled fbox2 outline=abc fill=sunshine line=1 color=#7799ff + + .put fbox + .put fbox2 y=200 +.end + +# actions +.flash name="action.swf" + + .box mybox width=100 height=100 fill=green + + .action: + { + _root.stop(); + } + .end + +.end +