SWFC Manual

Basic usage of swfc   Fonts   Shapes   >ActionScript<   Buttons   Blend Modes   Filters  


swfc has Actionscript support. For normal actionscript, which is executed once a given frame is reached, just open an .action block, and write the ActionScript into the block:

Code listing 4.1

.flash filename="action.swf" bbox=300x300 fps=50

.box mybox color=blue fill=green width=100 height=100
.put mybox

.frame 1
        _root.angle += 0.05;
        mybox._x = 100*Math.cos(_root.angle)+100;
        mybox._y = 100*Math.sin(_root.angle)+100;
.frame 2
.frame 3

For much more interesting ActionScript examples, see Laurent Lalanne's Flash Eyes or the source of Jean-Michel Sarlat's Mandelbrot explorer. or Sunder Iyer's swfc pages.
Previous: Shapes SWFC Manual: ActionScript Next: Buttons