test a = b instead of test a == b
[swftools.git] / doc / fileformat.sc
1 # ==================================================================================
2 #
3 # swfc(1) File format specification (well, sort of)
4 # Version: 0.1
5 #
6 # ==================================================================================
7
8 # Notice that the following is actually a valid .sc file, generating the four swfs
9 # spec.flash, scroll1.flash, scroll2.flash and simple_viewer.flash. (Provided all included 
10 # files are present)
11
12 # File header
13 # -----------
14
15 .flash bbox=200x200 version=6 fps=50 name="spec.swf" compress
16
17 # bbox=200x200         : set bounding box to 200x200
18 # bbox=200x200:100:100 : set bounding box to (100,100)-(300,300)
19 # bbox=autocrop        : (default) - make bbox just big enough so that nothing ever get's clipped
20 #
21 # all coordinates are in pixels, not in twips. fixed point values like 1.25, 333.40 are allowed.
22 #
23 # version=6    : generate flash mx movie
24 # fps=50       : set framerate to 50 frames/second
25 # name="..."   : save result to spec.flash. (Default: input file with extension 
26 #                                          changed to .flash, or the value of the -o command line 
27 #                                          parameter if given)
28
29 # load a simple object:
30 # ---------------------
31
32 .swf myshape1 "choo1.swf"
33 .swf myshape2 filename="choo1.swf" # long form
34 .swf myshape3 filename=choo1.swf # long form, without quotes
35 .swf myshape4 choo1.swf # short form, without quotes
36
37 #TODO: Do those files come from the current directory, the script directory or both?
38
39 # load an image:
40 # --------------
41
42 .jpeg background "panorama.jpg"
43 .jpeg background2 "panorama.jpg" quality=30% #reduces jpeg quality
44
45 .png background3 "choochoo.png"
46
47 # (you can put this directly (generating a shape), or insert it into a shape via the fill= argument
48
49 # define a texture from an image:
50 # -------------------------------
51
52 .texture text1=background scale=50% rotate=45
53
54 # define a gradient
55 # -----------------
56
57 #.gradient mygradient:
58 #    0.000 0 0 0
59 #    0.500 255 255 255
60 #    1.000 0 0 0
61 #.end
62
63 # load several pages:
64 # -------------------
65
66 .movie train1 "choochoopuff.swf"
67
68 # Notice: An embedded animation can't have a different framerate than
69 # the frame rate from the surrounding animation.
70
71 # Create simple objects:
72 # ----------------------
73
74 # We should support some primitives to not have to load everything
75 # from a file
76 .box mybox1 width=100 height=50 color=black fill=none #unfilled rectangle (just the lines)
77 .box mybox2 width=100 height=50 color=black           #same as above
78 .box mybox3 width=100 height=50 color=black fill      #filled black rectangle
79 .box mybox4 width=100 height=50 color=red line=2 fill=blue #blue rectangle with red edges
80 .box mybox5 width=100 height=50 color=red line=2 fill=background #part the background image, with red edges
81 .circle mycircle1 r=50 color=#aa33ff fill=background
82 .egon poly1 vertices=5
83
84 # Continuous soundtrack synched up to several frames in a row:
85 # ------------------------------------------------------------
86
87 # load a sound effect:
88 .sound sound1 "LocoStart.wav"
89
90 .frame 16
91     .play sound1 loop=1 #other arguments supported: nomultiple (don't start if already playing)
92
93 .frame 20
94 # this starts a synchronized soundtrack at this frame position. The command
95 # expects a filename, not a sound object, as it would be duplicating the
96 # sound object otherwise, and I'd rather have that done explicitly.
97     .soundtrack "LocoStart.wav"
98          #...  TODO: should .soundtrack sounds have a name? we could support
99              # .stop for them, which would simply stop generating mp3 data
100
101 .frame 55
102 # unlike characters, sounds can't have multiple instances, and can't
103 # be referenced once playing. So we stop the sound, not the instance.
104     .stop sound1
105
106 # Sound effects on user pressing or releasing a button 
107
108 .button playbutton shape=obj1
109     onMouseDown: {
110     }
111     onMouseUp: {
112     }
113 #    ...
114 .end
115 .buttonsounds playbutton press=sound1 release=sound2 enter=sound3 leave=sound4
116
117 # Elements of the movie should be animated by various means 
118 # moving (x,y and zoom) 
119 # ---------------------
120
121 .box obj1 width=200.0 height=100.0
122
123 .frame 100
124     .put obj1 x=0 y=0 #object starts at (0,0)
125
126 .frame 140
127     .change obj1 x+=100 y=0 scale=120% # smoothly move obj1 100 pixels to the right over 40 frames,
128                                        # scaling it to 120% of it's original size
129 .frame 170
130     .jump obj1 x=200 y=200 # make object to suddenly change to 200,200 at frame 70.
131
132 .frame 190
133     .qchange obj1 x=300 y=200 # make obj1 move towards 300,200...
134 .frame 210
135     .qchange obj1 x=300 y=300 # ... and then smoothly over to 300,300 using bspline interpolation
136
137 #.frame 220   #TODO
138 #    .jump obj1 x=reset y=reset
139
140 .frame 230
141     .del obj1   #Remove object again
142
143 # morphing (easy for simple polygons, hard for more complex shapes) 
144 # -----------------------------------------------------------------
145
146 .morphshape morphthing start="start.fig" end="end.fig"
147
148 #.morphshape blop [V77CJQAvn3KKYD8GDb4gFgbAZ4oM2RBdhOtvEVRdpNdIJF4tQ5gh7GzxnFYNvxe7lpXVranU
149 #                 +v/OjhGkCoUrOq9gUj4bJj0JjioYaA+VDsZ4Wq0+XLm0MiIgJZICQbADnUpdro5N11eVS699O]
150
151 # the following would be more work, but may be nice:
152 .box mybox6 width=100 height=50 color=black
153 .box mybox7 width=100 height=50 color=red
154 .morphshape morphthing2 start=mybox1 end=mybox2
155
156 # interpolation between crude manual animation frames
157 # ---------------------------------------------------
158
159 .swf ball "ball.fig" #The ball should be white or violet to make the cxforms below work
160
161 # now draw two balls, which fly around each other.
162
163 .frame 300
164 .put myball1=ball x=0 y=100 blue=0
165 .put myball2=ball x=100 y=100 red=0
166
167 .frame 310
168 # the .qchange means, "interpolate to this position and frame, using quadratic splines".
169          .qchange myball1 x=50 y=0
170          .qchange myball2 x=50 y=100
171
172 .frame 320
173 # We could also use coordinates relative to start position: .change myball1 x+=100 y+=0
174          .qchange myball1 x=100 y=100
175          .qchange myball2 x=0 y=100
176
177 .frame 330
178          .qchange myball1 x=50 y=100
179          .qchange myball2 x=50 y=0
180  
181 .frame 340
182 # Hmmm. This frame is the same as frame 0. How to prevent duplicating that one?
183          .qchange myball1 x=0 y=100
184          .qchange myball2 x=100 y=100
185
186 # fading into existence/out of existence (colour xform):
187 # ------------------------------------------------------
188
189 # .put, .change, .qchange, .jump all support params which result in color transform.
190 # Everything up to the + is multiplicated, the rest summed.
191 # TODO: negative values should also be allowed.
192
193 .put obj1 blue=50% #(scale blue color component to 50%)
194 .change obj1 blue=128 #(same as above)
195 .change obj1 red=+25% #(shift blue color component by 25%)
196 .change obj1 red=+64 #(same as above)
197 .change obj1 green=50%+50% #(scale green color component to 50% and then shift it by 50%)
198 .change obj1 green=128+128 #(same as above)
199 .change obj1 green=-1+255 #(invert green color component)
200 .change obj1 green=2-128  #(reduce spectrum for green to the upper 50%)
201 .change obj1 luminance=50% #(fade all color components 50% to black, same as red=50% green=50% blue=50%)
202 .change obj1 alpha=50% #(make object 50% transparent)
203
204 # scaling
205 # -------
206
207 .change obj1 scale=50%   # change an object to 50% of it's size
208 .change obj1 scaley=50%  # flatten object to 50% of it's height
209 .change obj1 scaley=110% scalex=75% #(funhouse mirror!)
210
211 # rotating
212 # --------
213
214 .change obj1 rotate=45  # tilt object, counterclockwise
215
216 # TODO: we still don't have full control over the 2x3 object-placement matrix.
217 #       (As we only have one parameter for the two values on the primary diagonal) ActionScript
218 #       has the same problem, however.
219
220 # sprites
221 # -------
222
223 # synonym: submovie
224
225 .sprite spr1
226     .frame 1    .put ball1=ball 0 0
227     .frame 2    .change ball1 100 100
228 .end
229
230 .sprite spr2
231     .frame 1    .put ball2=ball 100 0
232     .frame 7    .change ball2 0 100
233 .end
234
235 .frame 400
236     .put spr1
237     .put spr2
238
239 # so spr1 has three frames, spr2 has seven. The whole animation loops after 21 frames.
240
241 # multi-level nesting: (sprites can be nested to any depth)
242
243 .sprite mspr1
244     .sprite mspr2
245         .sprite spr3
246         .put ball 100 0
247         .end
248     .end
249 .end
250
251 # clipping an animation inside a star-shaped sprite:
252
253 .swf mystar1 "star.swf"
254 .movie anim1 "penguins.swf"
255
256 .sprite cspr1
257     .startclip mystar1
258         .put anim1
259     .end
260 .end
261 .frame 401
262     .put cspr1 rotate=0
263 .frame 402
264     .change cspr1 rotate=360
265
266 # buttons
267 # -------
268
269 # create at minimum a Play button and a Stop button, maybe a Rewind also 
270 .png playlogo "Play.png"
271 .png stoplogo "Stop.png"
272
273 .button myplaybutton shape=playlogo
274 #everything till the .end is actionscript.
275     press:
276         play "spr1"
277 .end
278 .button mystopbutton shape=stoplogo
279     press:
280         stop "spr1"
281 .end
282
283 .put myplaybutton x=100 y=100
284 .put mystopbutton x=200 y=100
285
286 # The following examples drop the .end command. This is only possible
287 # if we keep the leading dot (.) in the command names. (Due to naming
288 # conflicts with Actionscript)
289
290 # button which is blue, get's green when the mouse hovers over it, and
291 # white when it is pressed:
292
293 .button b1 shape=blueshape over=greenshape press=whiteshape
294
295 # button where the button position is not identical to the active area:
296
297 .button b2 area=activearea shape=blueshape over=greenshape press=whiteshape
298
299 # (if area is not set, it's the same as shape)
300
301 # the above put into use: pop up a window if the mouse cursor enters a certain
302 # area:
303
304 .button b3 area=activearea shape=emptyshape over=window1 press=window1
305
306 # button characters also support positioning and cxforming characters.
307 # to use this, we put the characters "virtually", and then use the
308 # instances in the button
309
310 .buttonput area1=playlogo x=300 y=400 rotate=0
311 .buttonput shape1=playlogo x=400 y=400 rotate=0 red=50%
312 .buttonput over1=playlogo x=400 y=400 rotate=30 red=50%
313 .buttonput press1=playlogo x=500 y=500 rotate=180
314 .button mybutton1 area=area1 shape=shape1 over=over1 press=press1
315      #[...actionscript...]
316 .end
317
318 # fonts
319 # -----
320
321 #only supported via other tools (lib/examples/makefonts) at the moment.
322
323 .font font1 "myfont.swf"
324
325 # text fields
326 # -----------
327
328 #(these are scalable vector objects just like shapes)
329 .text mytext1 "I am a happy little scroll message" color=blue size=100% font=font1
330 #TODO: clipping
331
332 # edittext
333 # --------
334
335 #(field where the flash animation can get input from the user)
336
337 .font helvetica "helvetica-bold.swf"
338 .edittext edittext1 text="Type something here" color=blue maxlength=200 font=helvetica size=24 width=320 height=200
339 # width/height: dimensions of the box
340 # text: The text which appears initally in the box, and can be overwritten by the user
341 # maxlength: max. length of the text the user can type
342 # color/font/size: Font appeareance
343 # variable: Name of the actionscript variable the text is stored in
344 # The following boolean options are also supported:
345 # password (show input only as stars), wordwrap, multiline, html, noselect, readonly
346
347 # actionscript
348 # ------------
349
350 #simplified:
351
352 .action:
353     stop spr1
354     setproperty spr1._visible 1  #TODO: spr1._visible=1?
355 .end
356
357 #full:
358
359 .action opcodes:
360     settarget "spr1"
361     stop
362     settarget ""
363     push "spr1"
364     push _visible
365     push 1
366     setproperty
367     end
368 .end
369
370 #simplified:
371
372 .button playbutton2 shape=obj1 opcodes:
373     press:   play spr1
374     release: stop spr1
375 .end
376
377 #full:
378
379 .button playbutton3 shape=obj1 opcodes:
380     press:
381         settarget "spr1"
382         play
383         settarget ""
384         end
385     # [...]
386 .end
387
388 # todo: mx initaction, placeobject2 initclip
389
390 # depth control
391 # -------------------
392
393 # .put, .change, .qchange, .jump, .startclip take before and after parameters,
394 # which can be used to specify the depth of an object
395
396 .put o1=obj1
397 .put o2=obj1 below=o1 x=50
398 .frame
399 .change o1
400 .change o2 above=o1 x=50
401
402 # newline conventions
403 # -------------------
404
405 # All Newlines are treated as normal whitespace. Therefore, splitting
406 # commands over several lines, like
407 .put obj2=obj1 x=300
408              y=300
409              red=100%
410              green=50%
411              blue=50%
412 # is allowed.
413
414 # Furthermore, having more than one command in one line is also possible:
415
416 .frame 600  .change obj1 x+=700  .change obj2 x+=300
417 .frame 601  .change obj1 x+=500  .change obj2 x+=500
418 .frame 602  .change obj1 x+=300  .change obj2 x+=700
419
420 .end # end of first file
421
422 # ==================================================================================
423 #
424 # Ok, now for some actual examples
425 #
426 # ==================================================================================
427
428 # scroll1.sc
429 #
430 # This example scrolls a single line of text from the bottom to the top, with
431 # a background image
432 #
433
434 .flash bbox=200x200 fps=25 version=6 name="scroll1.swf"
435
436 .jpeg background "panorama.jpg"
437
438 .font helvetica-bold "helvetica-bold.swf"
439 .text title1 "I am a happy little scroll message" color=blue font=helvetica-bold size=100%
440
441 .put background x=0 y=0
442
443 .frame 1
444 .put obj1=title1 x=0 y=200     # As text box positions are specified at the upper left corner, this
445                           # places the text just below the bottom.
446 # (.put title1 is actually .put title1=title1 (i.e. the instance has the same name as the character)
447
448 .frame 200
449     #
450     # "change" moves the object to the new position, _interpolating_ in the frames between.
451     # Do we also need a command for abruptly changing position (omitting interpolation)?
452     #
453 .change obj1 x=0 y-=12     # Now move the text up until it disappears at the top, in 40 frames
454
455 # to scroll horizontally, we would have modified the x instead of the y coordinate, and scrolled to -200
456 # (assuming the text is < 200 pixels)
457
458 .end
459
460 # ==================================================================================
461
462 # scroll2.sc
463 #
464 # This example now also fades the text in and out again
465 #
466
467 .flash bbox=200x200 fps=25 version=6 name="scroll2.swf"
468 .jpeg background "panorama.jpg"
469
470 #create some text for a title and credits 
471
472 .font helvetica "helvetica-bold.swf"
473 .text title1 "ChooChoo Train" color=blue font=helvetica size=100%
474
475 # move from bottom to top. Fade it in on the way,
476 # then fade it out again.
477 # TODO: the following looks like fading only if the background is black. Add alpha channel support.
478 .put obj1=title1 x=0 y=200 luminance=0%
479 .frame 100
480     .change obj1 luminance=100%
481 .frame 200
482     .change obj1 y-=12 luminance=0%
483
484 .end
485
486 # simpleviewer.sc
487 #
488 # Create the simple_viewer.flash file used in SWFTools.
489
490 .flash bbox=1024x768 version=4 fps=25 name="simple_viewer.swf"
491 .frame 1
492 .swf leftshape "left.fig"
493 .swf rightshape "right.fig"
494
495 .sprite viewport
496 .end
497
498 .action
499     stop viewport
500     setvariable "/subtitle" ""
501 .end
502
503 .buttonput left=leftshape luminance=50%
504 .buttonput lefthover=leftshape luminance=75%
505 .buttonput leftpress=leftshape luminance=100%
506 .button leftbutton shape=left over=lefthover press=leftpress
507     release: 
508         previousframe viewport
509 .end
510
511 .buttonput right=rightshape x=20 luminance=50%
512 .buttonput righthover=rightshape x=20 luminance=75%
513 .buttonput rightpress=rightshape x=20 luminance=100%
514 .button rightbutton shape=right over=righthover press=rightpress
515     release: 
516         nextframe viewport
517 .end
518
519 .font arial "arial.swf"
520 .edittext subtitlebox width=826 height=160 color=black variable="/:subtitle" font=arial size=24
521
522 .put viewport
523 .put leftbutton
524 .put rightbutton
525 .put subtitlebox x=40
526
527 .end
528
529 # boxlayers.sc
530 # test "above"
531
532 .flash bbox=400x300 version=4 fps=50 name="boxLayers.swf"
533
534 .box box1 width=100 height=100 color=white fill
535 .box box2 width=100 height=100 color=white fill
536
537 .frame 0
538      .put box1 x=30 y=10 blue=0 red=0 luminance=50
539      .put box2 x=60 y=40 green=0 red=0 luminance=50
540 .frame 100
541      .jump box1 above=box2
542 .frame 200
543      .jump box2 above=box1
544 .end
545
546 # ---------------------- everything below this line should actually be working ----------------------
547
548
549 # boxes.sc
550 #
551 # Do things with rectangles.
552
553 .flash bbox=autocrop version=6 fps=50 name="boxes.swf" compress
554
555     .box box1 width=100 height=100 color=red fill #filled red box
556     .box box2 width=100 height=100 color=white    #white hollow frame
557     .box box3 width=100 height=100 color=green line=10 fill=blue #filled blue box, with thick green border
558     
559 .frame 0  
560         .put box1 x=30 scalex=30
561         .put box2 x=30 scalex=30
562         .put box3 x=30 scalex=30
563 .frame 100
564         .change box1 x+=300 scalex=100
565         .change box2 y+=300 scalex=100
566         .change box3 x+=300 y-=300 scalex=100
567 .frame 150
568         .del box1
569         .del box2
570         .del box3
571 .end
572
573 # monkey.sc
574 #
575
576 .flash bbox=autocrop version=4 fps=50 name="monkey.swf"
577
578     .swf island "island.swf"
579     .swf monkey "monkey4.swf"
580     .put island
581     .point leftfoot 45 177
582     .point rightfoot 138 177
583     .frame 0 .put monkey 160 160
584     .frame 20 .change monkey 160 160
585     .frame 30 .change monkey 160 122
586     .frame 35 .change monkey 160 112
587     .frame 40 .change monkey 160 122
588     .frame 50 .change monkey 160 160
589     
590     .frame 70 .change monkey 205 337 pin=leftfoot rotate=0 
591     .frame 90 .change monkey rotate=30
592     .frame 100 .change monkey rotate=30
593     .frame 120 .change monkey rotate=0
594     .frame 122 .change monkey 298 337 pin=rightfoot rotate=0
595     .frame 140 .change monkey rotate=-30
596     .frame 150 .change monkey rotate=-30
597     .frame 170 .change monkey rotate=0
598 .end
599
600 # cxform.sc
601 #
602 # Try color transforms
603
604 .flash name="cxform.swf" version=5
605     
606     .swf s1 "photo.swf"
607
608     .put s1 x=50 y=50 scalex=110 scaley=110
609     .frame 100
610     .change s1 x=0 y=0 scalex=210 scaley=210 red=-1+255 green=-1+255 blue=-1+255 #invert
611     .frame 200
612     .change s1 x=100 y=50 scalex=110 scaley=110 red=0 green=+0 blue=+0 #remove red
613     .frame 300
614     .change s1 x=0 y=0 scalex=210 scaley=210 red=+0 green=2 blue=-1+255 #amplify green, invert blue
615     .frame 400
616     .change s1 x=50 y=100 scalex=110 scaley=110 red=2-128 green=-2+255 blue=+0.7+40 #alien glow
617     .frame 500
618     .change s1 x=0 y=0 scalex=210 scaley=210 red=8-1024 green=8-1024 blue=8-1024 #palette reduce
619     .frame 600
620     .change s1 x=0 y=0 scalex=210 scaley=210 red=+0 green=+0 blue=+0 #back to normal
621     .frame 700
622     .change s1 x=105 y=105 scalex=0 scaley=0 luminance=0 #fadeout
623 .end
624
625 # transparency.sc
626 #
627 # Test transparency
628
629 .flash bbox=200x200 version=5 fps=25 name="transparency.swf"
630
631 .box box1 90 90 color=yellow fill=blue line=5
632 .box box2 90 90 color=white fill=red line=5
633
634 .put b1=box1 75 75 rotate=0
635 .put b2=box1 75 75 rotate=90
636 .put b3=box1 75 75 rotate=180
637 .put b4=box1 75 75 rotate=270
638 .put box2 30 30 alpha=100%
639 .frame 300
640 .change b1 rotate+=360
641 .change b2 rotate+=360
642 .change b3 rotate+=360
643 .change b4 rotate+=360
644 .change box2 alpha=0%
645 .end
646
647
648 # points.sc
649 #
650 # Test points, pivots, pins
651
652 .flash version=5 fps=20 name="points.swf"
653
654 .box box 90 90 color=white fill=red line=5
655 .point center 45 45
656 .point corner1 0 0 
657 .point corner2 90 0 
658 .point corner3 90 90 
659 .point corner4 0 90 
660
661 .put b1a=box x=90 y=90 pin=center
662 .put b1b=box x=90 y=90 pin=center alpha=50%
663 # OR: .put b1=box x=90 y=90 pin=(45,45) rotate=0
664
665 .put b2=box x=90 y=90 pin=corner1 alpha=75% blue=+128 red=0.2
666 .put b3=box x=90 y=90 pin=corner2 alpha=75% blue=+128 red=0.2
667 .put b4=box x=90 y=90 pin=corner3 alpha=75% blue=+128 red=0.2
668 .put b5=box x=90 y=90 pin=corner4 alpha=75% blue=+128 red=0.2
669
670 .frame 100
671 .change b1a rotate-=720
672 .change b1b rotate+=720
673 .change b2 rotate+=360
674 .change b3 rotate-=360
675 .change b4 rotate+=360
676 .change b5 rotate-=360
677
678 .end
679
680 # clipping.sc
681 #
682 # Test clipping
683
684 .flash name="clip.swf" fps=25
685     .sprite s1 # this just constructs a colorful object "s1"
686         .box b1 40 40 color=red fill=violet line=10
687         .box b2 40 40 color=blue fill=green line=10
688         .box b3 40 40 color=yellow fill=cyan line=10
689         .box b4 40 40 color=white fill=black line=10
690         .put b1 0 0
691         .put b2 60 0
692         .put b3 60 60
693         .put b4 0 60
694     .end
695
696     # the line and fill colors of the circle don't actually do anything-
697     # as it's used for clipping only it's shape matters
698     .circle c1 80 color=blue fill=green
699
700     .startclip c1 x=-160 y=-160 #c1 clips...
701         .put s1  # ...the sprite s1
702     .end
703
704 .frame 200
705     .change c1 x=160 y=160 # movement doesn't change the clipping property
706     .change s1 rotate=5
707
708 .end
709
710 # fonts.sc
711 #
712 # fonts&text
713
714 .flash name="fonts.swf"
715     .font courier "Courier.swf"
716     .font helvetica "Helvetica.swf"
717     .text abc text="abcdefghijklmnopqrstuvwxyz" font=courier size=100% color=blue
718     .text abc2 text="abcdefghijklmnopqrstuvwxyz" font=helvetica size=100% color=red
719     .put abc
720     .put abc2 y=200
721 .end
722
723
724 # shear.sc
725 #
726 # Shearing
727
728 .flash bbox=300x200:-30 name="shear.swf" fps=25
729     .font helvetica "Helvetica.swf"
730     .text text text="Shear" font=helvetica size=100% color=yellow
731     .put t0=text y=150 alpha=0% shear=0
732     .put t1=text y=150 alpha=0% shear=1
733     .put t2=text y=150 alpha=0% shear=2
734     .put t3=text y=150 alpha=0% shear=3
735     .put t4=text y=150 alpha=0% shear=4
736     .put t5=text y=150 alpha=0% shear=5
737     .put t6=text y=150 alpha=0% shear=6
738     .put t7=text y=150 alpha=0% shear=7
739     .put t8=text y=150 alpha=0% shear=8
740     .put t9=text y=150 alpha=0% shear=9
741     .frame 50
742     .change t0 alpha=40% shear=0
743     .change t1 alpha=40% shear=0
744     .change t2 alpha=40% shear=0
745     .change t3 alpha=40% shear=0
746     .change t4 alpha=40% shear=0
747     .change t5 alpha=40% shear=0
748     .change t6 alpha=40% shear=0
749     .change t7 alpha=40% shear=0
750     .change t8 alpha=40% shear=0
751     .change t9 alpha=40% shear=0
752     .frame 100
753     .change t0 .change t1 .change t2 .change t3 .change t4
754     .change t5 .change t6 .change t7 .change t8 .change t9
755     .frame 150
756     .change t0 alpha=0% shear=-9
757     .change t1 alpha=0% shear=-8
758     .change t2 alpha=0% shear=-7
759     .change t3 alpha=0% shear=-6
760     .change t4 alpha=0% shear=-5
761     .change t5 alpha=0% shear=-4
762     .change t6 alpha=0% shear=-3
763     .change t7 alpha=0% shear=-2
764     .change t8 alpha=0% shear=-1
765     .change t9 alpha=0% shear=-0
766 .end
767
768 # sound.sc
769 #
770 # Sound effects
771
772 .flash name="sound.swf" fps=25
773 .sound loco "LocoStart.wav"
774 .sound whistle "Whistle.wav"
775
776 .frame 0
777     .play loco
778 .frame 25
779     .stop loco
780     .play whistle loop=20
781 .frame 200
782     .stop whistle
783 .end
784
785
786 # outline.sc
787 #
788 # Outlines /Fillings
789
790 .flash name="outline.swf"
791
792     .outline box:
793         moveTo 0,0
794         lineTo 100,0
795         lineTo 100,100
796         lineTo 0,100
797         lineTo 0,0
798     .end
799
800     .font arial "Arial.swf"
801
802     .textshape abc font="arial" text="Hello World"
803
804 #   .gradient bluegreen:
805 #       0% blue
806 #       50% green
807 #       100% red
808 #   .end
809
810     .filled fabc outline=box fill=#ff6633 line=5 color=#7799ff
811     .filled fbox outline=abc fill=#ff6633 line=5 color=#7799ff
812
813     .put fabc
814     .put fbox y=200
815 .end
816
817 # gradients
818 .flash name="gradient.swf"
819     
820     .font arial "Arial.swf"
821     .textshape abc font="arial" text="Hello World"
822
823     .gradient bluegreen:
824         0% blue
825         50% green
826         100% red
827     .end
828     
829     .gradient sunshine radial:
830         0% white
831         50% yellow
832         100% red
833     .end
834
835     .filled fbox outline=abc fill=bluegreen line=1 color=#7799ff
836     .filled fbox2 outline=abc fill=sunshine line=1 color=#7799ff
837
838     .put fbox
839     .put fbox2 y=200
840 .end
841
842 # actions
843 .flash name="action.swf"
844
845     .box mybox width=100 height=100 fill=green
846
847     .action:
848         {
849             _root.stop(); 
850         }
851     .end
852
853 .end
854