home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 10 / AU_CD10.iso / Archived / Updates / Flash / writeflash / !MakeFlash / !Help < prev    next >
Text File  |  2000-06-04  |  30KB  |  980 lines

  1.  
  2.  writeflash 0.10
  3.  ===============
  4.  writeflash creates Flash 3 files from simple script-files.
  5.  !MakeFlash is a simple frontend for writeflash.
  6.  
  7.  
  8.  Copyright
  9.  =========
  10.  The program is copyright © Henrik Bjerregaard Pedersen, 2000 and is
  11.  released under the GPL (any version).
  12.  
  13.  
  14.  Using writeflash
  15.  ================
  16.  writeflash is a command-line program and may be run from a task-window,
  17.  shell or obey-file or from another program.
  18.  
  19.  writeflash [-pl] <input> [<output>]
  20.  
  21.  If no output file is specified, the result will be output to the
  22.  standard output stream - either the screen (bad idea) or a file,
  23.  depending on redirection.
  24.  
  25.  Switches:          -pl       print lines as they are being read
  26.                               by the parser; this is very useful if
  27.                               the parser reports an error, as it
  28.                               allows you to easily find which line
  29.                               contains the error
  30.  
  31.  Using !MakeFlash
  32.  ================
  33.  MakeFlash is a simple frontend for writeflash. When run, it installs
  34.  itself on the iconbar, and you may then drag a script-file to its
  35.  icon - a save-box will then pop up.
  36.  
  37.  
  38.  Script file syntax
  39.  ==================
  40.  A script-file is a text file containing a textual description of the
  41.  flash file you want to create.
  42.  The script-file may also contain commands for the script-processor;
  43.  the script-processor greatly simplifies many trivial operation when
  44.  creating the script-file.
  45.  
  46.  The script-file is read line by line but is parsed one token at a time.
  47.  A token is either a tag (eg. "FileVersion" or "DefineShape") or a
  48.  fieldname (eg. "id" or "matrix") or a value or left or right curly
  49.  brackets. Tokens must be seperated by a white-space (space, linefeed,
  50.  carriage-return or TAB).
  51.  
  52.  Tags and fieldnames are case-insensitive.
  53.  
  54.  Comments may be included in a script-file:  // indicates that the rest
  55.  of the line is a comment.
  56.  
  57.  All tags except FileVersion, FrameRate and BackgroundColour require a
  58.  structure as argument.
  59.  A structure contains a number of fieldnames/values.
  60.  A structure starts with a "{"  (left curly bracket), then follows
  61.  pairs of fieldnames and values (values may be structures themselves,
  62.  although in that case the are no fieldnames in the structure) and
  63.  the list is terminated by a "}" (right curly bracket); eg.:
  64.  
  65.           PlaceObject {
  66.             depth  1
  67.             id     1
  68.             matrix {
  69.                65536 65536
  70.                0     0
  71.                0     0
  72.             }
  73.           }
  74.  
  75.  
  76.  Types
  77.  =====
  78.  The following data types are supported:
  79.  
  80.  U8                 unsigned 8 bit integer
  81.  S8                 signed 8 bit integer
  82.  U16                unsigned 16 bit integer
  83.  S16                signed 16 bit integer
  84.  U32                unsigned 32 bit integer
  85.  S32                signed 32 bit integer
  86.  bbox               { S32 S32 S32 S32 }
  87.  matrix             { S32 S32 S32 S32 S32 S32 }
  88.  cxform             { S16 S16 S16 S16 S16 S16 S16 S16}
  89.  RGB                { U8 U8 U8 }
  90.               or    24 bit integer      (written as hex: BBGGRR)
  91.  RGBA               { U8 U8 U8 U8 }
  92.               or    32 bit integer      (written as hex: AABBGGRR)
  93.  gradient           1..8 pairs of U8 RGBA
  94.  string             string, enclosed in " "
  95.  
  96.  
  97.  RGBA
  98.  ====
  99.  RGBA values are specified as either 
  100.  
  101.  A) a structure with 3 or 4 values { R G B A }, eg.
  102.     { 0 128 64 255 }   for    R (red)   = 0          (0%)
  103.                               G (green) = 128        (50%)
  104.                               B (blue)  = 64         (25%)
  105.                               A (alpha) = 255        (100%)
  106.  
  107.    if only 3 values are specified, A is set to 255
  108.  
  109.  or
  110.  
  111.  B) an 8 digit hexadecimal value, eg  00446688
  112.      for      A (alpha) = 0   (0x00)  (0%)
  113.               B (blue)  = 68  (0x44)  (26%)
  114.               G (green) = 102 (0x66)  (40%)
  115.               R (red)   = 136 (0x88)  (53%)
  116.  
  117.  An alpha value of 0 means completely transparent, 255 (0xff) means
  118.  completely opaque.
  119.  
  120.  
  121.  Matrix
  122.  ======
  123.  Often matrices only contain scaling or scaling/translation. To make
  124.  entry of these easier, you may specify less than the usual 6 values
  125.  in a matrix. The remaining values are set to their default values,
  126.  which are:
  127.           scalex              65536
  128.           scaley              65536
  129.           rotate0             0
  130.           rotate1             0
  131.           translatex          0
  132.           translatey          0
  133.  
  134.  no. of values      treated as
  135.  
  136.      0              (default values)
  137.      1              scaling (both scalex and scaley)
  138.      2              scalex , scaley
  139.      3              scaling, translatex, translatey
  140.      4              scalex, scaley, translatex, translatey
  141.      5              NOT ALLOWED
  142.  
  143.  
  144.  Colour Transforms (cxform)
  145.  ==========================
  146.  A colour-transform transform RGBA values in a shape, using the formulaes
  147.  
  148.           R = R*MULR/255 + ADDR
  149.           G = G*MULG/255 + ADDG
  150.           B = B*MULB/255 + ADDB
  151.           A = A*MULA/255 + ADDA
  152.  
  153.  The format of a colourtransform is
  154.  
  155.           { MULR MULG MULB MULA ADDR ADDG ADDB ADDA }
  156.  
  157.  
  158.  IDs
  159.  ===
  160.  Flash uses 16 bit IDs to reference objects, characters, bitmaps, fonts
  161.  etc. IDs should be unique within a Flash-file.
  162.  
  163.  writeflash will assume that IDs from 20000 to 49999 are reserved for
  164.  future use by writeflash, IDs from 50000 to 59999 are reserved for
  165.  fonts and IDs from 60000 to 65535 are reserved for other pre-defined
  166.  shapes.
  167.  
  168.  
  169.  Supported tags
  170.  ==============
  171.  The following tags are supported:
  172.  
  173.                               aliases
  174.  
  175.           FileVersion
  176.           FrameArea
  177.           FrameRate
  178.           BackgroundColour    BgColour
  179.           DefineShape         Shape
  180.           PlaceObject         Place
  181.           RemoveObject        Remove
  182.           DefineSound         Sound
  183.           PlaySound
  184.           ShowFrame
  185.           DoAction
  186.           Protect
  187.           Text
  188.           Font
  189.           JPEG
  190.           Button
  191.           End
  192.  
  193.  
  194.  Tags
  195.  ====
  196.  
  197.  FileVersion
  198.  -----------
  199.  Defines the version of the file. There should only be one "FileVersion"
  200.  tag in a script.
  201.  
  202.  Argument:          U8
  203.  
  204.  Example:           FileVersion 1
  205.  
  206.  
  207.  FrameArea
  208.  ---------
  209.  Specifies the size of the display area for the Flash file; also
  210.  defines the scaling factors for all coordinates in the script-file.
  211.  
  212.  Argument:          framearea-structure
  213.  
  214.  Example:           FrameArea {
  215.                       width  5000
  216.                       height 4000
  217.                       scalex 1000
  218.                       scaley -1000      // flip y
  219.                     }
  220.  
  221.  The framearea-structure may include any of the following fields:
  222.  
  223.                     name                argumenttype
  224.  
  225.                     width               U16
  226.                     height              U16
  227.                     scalex              S32
  228.                     scaley              S32
  229.  
  230.  The default value for scalex and scaley is 1000 (100%).
  231.  The scale/rotateskew values in a matrix cannot be scaled using
  232.  scalex and scaley; instead, they are all scaled using
  233.  SQRT(ABS(scalex*scaley)).
  234.  
  235.  You may include more than one FrameArea tag in a script-file.
  236.  
  237.  
  238.  FrameRate
  239.  ----------
  240.  Specifies the framerate for the Flash file.
  241.  
  242.  Argument:          U8.U8
  243.  
  244.  Example:           FrameRate 10.0
  245.  
  246.  
  247.  BackgroundColour  /  BGColour
  248.  -----------------------------
  249.  Specifies the background colour for the Flash file.
  250.  
  251.  Argument:          RGB
  252.  
  253.  Examples:          BackgroundColour ff0000       // blue
  254.                     BackgroundColour { 0 0 255 }  // blue
  255.  
  256.  
  257.  DefineShape  /  Shape
  258.  ---------------------
  259.  Defines a shape which is added to the dictionary of defined characters.
  260.  
  261.  Argument:          shape-structure
  262.  
  263.  Example:           DefineShape {
  264.                       id 1
  265.                       fillstyle {
  266.                         solid ff00ff00            // fillestyle #1
  267.                         linear {                  // fillestyle #2
  268.                           matrix { 65536 65536 0 0 0 0 }
  269.                           gradient { 0 00ff00  255 008000 }
  270.                         }
  271.                       }
  272.                       linestyle { 80 ffff0000     // define linestyle#1
  273.                                   80 ff000000 }   // define linestyle#2
  274.                       selectlinestyle 1           // default is 0, which
  275.                       fill0 2                     // means "don't draw"
  276.                       fill1 1
  277.                       moveby { 200 200 }
  278.                       lineby { 200 0 }
  279.                     }
  280.  
  281.  Possible fields in the shape-structure:
  282.  
  283.                     name                argumenttype
  284.  
  285.                     id                  U16     (required)
  286.                     bbox                bbox    (only used in v0.02)
  287.                     linestyle           linestyle-structure
  288.                     fillstyle           fillstyle-structure
  289.                     selectlinestyle     U32
  290.            selectfillstyle0   fill0     U32
  291.            selectfillstyle1   fill1     U32
  292.                     moveto              { S32 S32 }
  293.                     moveby              { S32 S32 }
  294.                     lineby              { S32 S32 }
  295.                     curveby             { S32 S32 S32 S32 }
  296.  
  297.  
  298.  Each fillstyle/linestyle structure defines a number of fill- or
  299.  line-styles. You may have multiple fillstyle/linestyle structures.
  300.  A fillstyle-structure contains any combination of the following fields:
  301.  
  302.                     name                argumenttype
  303.  
  304.                     solid               RGBA
  305.                     linear              gradient-fill-structure
  306.                     radial              gradient-fill-structure
  307.                     tiled               bitmap-fill-structure
  308.                     clipped             bitmap-fill-structure
  309.  
  310.  
  311.  A linestyle-structure one or more pairs of linestyle-values - first
  312.  value is the linewidth (U16), second value is the colour (RGBA).
  313.  
  314.  
  315.  A gradient-fill-structure contains the following fields:
  316.  
  317.                     name                argumenttype
  318.  
  319.                     matrix              matrix
  320.                     gradient            gradient
  321.  
  322.  A bitmap-fill-structure contains the following fields:
  323.  
  324.                     name                argumenttype
  325.  
  326.                     id                  U16
  327.                     matrix              matrix
  328.  
  329.  
  330.  
  331.  PlaceObject  /  Place
  332.  ---------------------
  333.  Places a character (a shape from from the dictionary) on the screen.
  334.  
  335.  Argument:          place-object-structure
  336.  
  337.  Example:           PlaceObject {
  338.                       id 1
  339.                       depth 1
  340.                       matrix {
  341.                         32768 32768
  342.                         0 0
  343.                         0 0
  344.                       }
  345.                     }
  346.  
  347.  The place-object-structure must contain the following fields:
  348.  
  349.                     name                argumenttype
  350.  
  351.                     depth               U16
  352.  
  353.  and may also contain:
  354.  
  355.                     id                  U16
  356.                     matrix              matrix
  357.                     cxform              cxform
  358.                     clip                U16
  359.                     frame               U16
  360.  
  361.  Only one object can exist at a given depth.
  362.  If no id is given in the place-object-structure, it is assumed that
  363.  the matrix (and cxform) modify the object at the specified depth.
  364.  
  365.  Notice, you cannot place bitmaps (eg. JPEGs) on the screen this way.
  366.  You have to create a shape which uses the bitmap for filling and then
  367.  place that object.
  368.  
  369.  If a frame number is given in the structure, the object will be placed
  370.  in the specified frame; you can only address previously defined frames
  371.  this way.
  372.  
  373.  'clip' allows a shape to mask out shapes on lower levels.
  374.  
  375.  
  376.  RemoveObject  /  Remove
  377.  -----------------------
  378.  Removes an object (a character) from the screen.
  379.  
  380.  Argument:          remove-object-structure
  381.  
  382.  Example:           RemoveObject {
  383.                       id 5              // not needed, ignored
  384.                       depth 5
  385.                     }
  386.  
  387.  The remove-object structure must contain the following fields:
  388.  
  389.                     name                argumenttype
  390.  
  391.                     depth               U16
  392.  
  393.  and may also contain the following fields:
  394.  
  395.                     frame               U16
  396.  
  397.  
  398.  If a frame number is given in the structure, the object will be removed
  399.  from the screen at the specified frame; you can only address previously
  400.  defined frames this way.
  401.  
  402.  
  403.  ShowFrame
  404.  ---------
  405.  Displays the frame.
  406.  
  407.  Argument:          an empty structure
  408.  
  409.  Example:           ShowFrame {
  410.                     }
  411.  
  412.  
  413.  Protect
  414.  -------
  415.  Protect the file from editing in editors.
  416.  
  417.  Argument:          an empty structure
  418.  
  419.  Example:           Protect {
  420.                     }
  421.  
  422.  
  423.  DoAction
  424.  --------
  425.  Adds a number of actions to the current frame.
  426.  
  427.  Argument:          action-list structure
  428.  
  429.  Examples:          DoAction {
  430.                       gotoframe 0
  431.                       play
  432.                     }
  433.  
  434.                     DoAction {
  435.                       geturl {
  436.                         url     "http://www.hanseman-luchter.net"
  437.                         target  "__new"  // or whatever...
  438.                       }
  439.                     }
  440.  
  441.  The action-list structure contains a list of actions; each action
  442.  starts with the actionname and is followed by the arguments (if any)
  443.  to the action. Currently supported actions are:
  444.  
  445.                     name                argumenttype
  446.  
  447.                     gotoframe           U16       (frame no.)
  448.                     play                -
  449.                     stop                -
  450.                     nextframe           -
  451.                     previousframe       -
  452.                     stopsounds          -
  453.                     geturl              geturl-structure
  454.  
  455.  The geturl-structure must include the following fields:
  456.  
  457.                     url                 string
  458.  
  459.  and may optionlly also include the following fields:
  460.  
  461.                     target              string
  462.  
  463.  Action-list structures are also used when defining buttons.
  464.  
  465.  
  466.  JPEG
  467.  ----
  468.  Adds a JPEG to the dictionary.
  469.  
  470.  Argument:          JPEG-structure
  471.  
  472.  Example:           JPEG {
  473.                       id 54
  474.                       file "test2.jpg"
  475.                       width 200
  476.                       height 160
  477.                       alphafile "test2.alpha"
  478.                     }
  479.  
  480.  The JPEG-structure must include the following fields:
  481.  
  482.                     name                argumenttype
  483.  
  484.                     id                  U16
  485.                     file                string
  486.  
  487.  and may also include the following fields:
  488.  
  489.                     alphafile           string
  490.                     width               U16
  491.                     height              U16
  492.  
  493.  If the alphafile field is included, the file is assumed to contain a
  494.  ZLIB compressed 8 bits-per-pixel image with the same dimensions as the
  495.  JPEG. The width and height fields MUST be present if the alphafile
  496.  field is included.
  497.  
  498.  
  499.  Button
  500.  ------
  501.  Creates a button.
  502.  
  503.  Argument:          button-structure
  504.  
  505.  Example:           Button {
  506.                       id 9
  507.                       up {
  508.                         id 6
  509.                         depth 6   // not quite sure what this does
  510.                       }
  511.                       actions {
  512.                         gotoframe 15
  513.                         play
  514.                       }
  515.                     }
  516.  
  517.  The button-structure must contain the following fields:
  518.  
  519.                     name                argumenttype
  520.  
  521.                     id                  U16
  522.                     up                  buttonstate structure
  523.                     actions             action-list structure
  524.                                         (see DoAction)
  525.  
  526.  and may also contain these fields:
  527.  
  528.                     over                buttonstate structure
  529.                     down                buttonstate structure
  530.                     activearea          buttonstate structure
  531.  
  532.  
  533.  The buttonstate structures contain the following fields:
  534.  
  535.                     id                  U16
  536.                     depth               U16
  537.  
  538.  and may also include the following fields:
  539.  
  540.                     matrix              matrix
  541.  
  542.  The various buttonstate structures define which character (which must
  543.  also be defined in the script-file) to use for the various states
  544.  of the button. The activearea structure defines which character to
  545.  use to detect when the mouse is over the button.
  546.  
  547.  You may include multiple up/over/down/activearea structure in a
  548.  button. The over/down/activearea structures default to the same
  549.  as the up structure.
  550.  
  551.  
  552.  Font
  553.  ----
  554.  Defines a font.
  555.  
  556.  Argument:          font-structure
  557.  
  558.  Example:           Font {
  559.                       id 55
  560.                       glyph {
  561.                         char "A"
  562.                         moveby { 100 1000 }
  563.                         curveby { 1000 1000 1000 -1000 }
  564.                         lineby { -1000 -1000 }
  565.                         lineby { -1000 1000 }
  566.                       }
  567.                       glyph {
  568.                         char "x"
  569.                         moveby { 100 1000 }
  570.                         curveby { 1000 1000 1000 -1000 }
  571.                         lineby { -1000 -1000 }
  572.                         lineby { -1000 1000 }
  573.                       }
  574.                       scale { 46200 45600 }
  575.                       spacing 100
  576.                     }
  577.  
  578.  The font-structure must contain the 'id' field, and a least one
  579.  glyph structure:
  580.  
  581.                     name                argumenttype
  582.  
  583.                     char                string (one char) or U8
  584.  
  585.  A glyph-structure must also contains a shape, in the form of a
  586.  sequence of moveto { }, moveby { }, lineby { }  and curveby { }
  587.  structures.
  588.  
  589.  The font-structure may also include the following fields:
  590.  
  591.                     scale               { S32 S32 }
  592.                     spacing             S16
  593.  
  594.  The scale field specifies how to scale the coordinates in the
  595.  glyph-shapes. The glyph-coordinates should be scaled so that all
  596.  glyphs fit inside a 1024x1024 box (the EM square).
  597.  
  598.  The spacing is inserted between each char/letter.
  599.  
  600.  A font-defintion for all letters, numbers etc. may take up several
  601.  kbytes; therefore writeflash doesn't save a glyph (the shape defining
  602.  a letter or number or sign) if it isn't being used by any of the
  603.  text-objects in the file; eg. if you define a font with 100 glyphs,
  604.  but only use the glyphs for the letters in the word 'Hello', then only
  605.  the glyphs for the letters 'H', 'e', 'l', and 'o' will be saved.
  606.  However, this can be disabled by defining the macro INCLUDE_ALL_GLYPHS,
  607.  ie. by including the line  '#define INCLUDE_ALL_GLYPHS'  in the script.
  608.  
  609.  
  610.  DefineSound / Sound
  611.  -------------------
  612.  Adds a sound to the dictionary.
  613.  
  614.  Argument:          sound-structure
  615.  
  616.  Example:           Sound {
  617.                       id 123
  618.                       file "$.samplefile"
  619.                       format "LIN8"
  620.                       channels 1
  621.                       freq 22
  622.                     }
  623.  
  624.  The sound-structure must include the following fields:
  625.  
  626.                     name                argumenttype
  627.  
  628.                     id                  U16
  629.                     file                string
  630.                     format              string
  631.                     channels            U16
  632.                     freq                U16
  633.  
  634.  format must be either "LIN8", "LIN16", "ADPCM2", "ADPCM3", "ADPCM4"
  635. or "ADPCM5" (case-sensitive).
  636.  The value of the channels field must be either 1 (mono) or 2 (stereo).
  637.  The freq field specifies the sample rate. It must be either
  638.  5 (5.5kHz), 11 (11kHz), 22 (22kHz) or 44 (44kHz).
  639.  
  640.  The file will simply be inserted as the SoundData field in the
  641. DefineSound structure, ie. it will not be processed or converted in any
  642. way, and if the file has some kind of header, that will be included
  643. as well.
  644.  ADPCM and stereo formats have not been tested.
  645.  
  646.  
  647.  PlaySound
  648.  ---------
  649.  Plays a sound.
  650.  
  651.  Argument:          playsound-structure
  652.  
  653.  Example:           PlaySound {
  654.                       id 123
  655.                       loops 3
  656.                       frame 45
  657.                     }
  658.  
  659.  The playsound-structure must contain the id field, and may also contain
  660. any of the following fields:
  661.  
  662.                     name                argumenttype
  663.  
  664.                     loops               U16
  665.                     frame               U16
  666.  
  667.  If a frame number is given in the structure, the sound will be played
  668.  at the specified frame; you can only address previously defined frames
  669.  this way.
  670.  
  671.  
  672.  Text
  673.  ----
  674.  Defines a text-string.
  675.  
  676.  Argument:          text-structure
  677.  
  678.  Example:           Text {
  679.                       id 56             // to be used by PlaceObject { }
  680.                       matrix { }        // default matrix
  681.  
  682.                       style {
  683.                         font 55
  684.                         size 48
  685.                         colour ffffff00
  686.                         move { 10261 0 }
  687.                       }
  688.                       text "Hello, world!"
  689.                     }
  690.  
  691.  The text-structure must include the 'id' field, and may also include
  692.  a transformation matrix. Besides that, the text-structure must also
  693.  contain at least one style- and one text-field.
  694.  
  695.                     name                argumenttype
  696.  
  697.                     text                string
  698.                     style               textstyle-structure
  699.  
  700.  There must be a style-field before the first text-field, otherwise
  701.  the player will not know which font/fontsize/colour/position to
  702.  use.
  703.  
  704.  The textstyle-structure may contain any of these fields (the first
  705.  textstyle-structure in a text-structure must contain all fields):
  706.  
  707.                     name                argumenttype
  708.  
  709.                     font                U16
  710.                     size                U16
  711.                     colour              RGBA
  712.                     move                { S16 S16 }
  713.  
  714.  
  715.  Preprocessor/Script-processor
  716.  ==============================
  717.  The script-processor provides both a simple one-pass preprocessor
  718.  and allows you to do things like looped and conditional parsing.
  719.  
  720.  Preprocessor
  721.  ------------
  722.  Lines starting with the character '#' are considered
  723.  preprocessor-directives and are processed when the script-file is read
  724.  into memory before parsing.
  725.  That the pre-processor is 'one-pass' means that macros may refer to
  726.  other macros that have been define earlier in the file, but they may
  727.  not refer to macros that are defined later on in the file.
  728.  
  729.  The following preprocessor-directives are supported:
  730.  
  731.  #include <filename>
  732.  -------------------
  733.  Inserts the specified file in the script; this allows you to build
  734.  a library of commonly used shapes (eg. fonts or logos) and reuse them
  735.  in any script-file.
  736.  
  737.  Example:           #include FlashLib:Fonts.Homerton.Medium
  738.  
  739.  #define <macroname> [<value>]
  740.  -----------------------------
  741.  Defines a macro, and optionally assignes a value to it. Whenever
  742.  the script-file parser finds a reference to the macro, it is replaced
  743.  with the value of the macro.
  744.  It may also be used together with #ifdef and #ifndef to force the
  745.  parser to ignore parts of the script-file.
  746.  
  747.  Examples:          #define INCLUDE_LOGO
  748.                     #define FONTSIZE    45
  749.                     #define FILLSTYLE3 { solid ff00ff00 }
  750.  
  751.  Macronames must start with a letter or the character '_', and may only
  752.  include letters, numbers and the character '_'.
  753.  
  754.  #ifdef <macroname>
  755.  ------------------
  756.  The script-file lines following the #ifdef lines (until an #endif) are
  757.  only parsed if the macro has been defined. 
  758.  #ifdef .. #endif may be nested.
  759.  
  760.  Example:           #ifdef INCLUDE_LOGO
  761.                     PlaceObject { id LOGOID
  762.                                   depth LOGODEPTH 
  763.                                   matrix { } }
  764.                     #endif
  765.  
  766.  #ifndef <macroname>
  767.  -------------------
  768.  Similar to #ifdef, except the lines are only parsed if the macro
  769.  hasn't been defined.
  770.  
  771.  #else
  772.  -----
  773.  Used between #ifdef .. #endif or between #ifndef .. #endif 
  774.  
  775.  Example:           #ifdef USE_UPPER_CASE
  776.                           text "HELLO WORLD"
  777.                     #else
  778.                           text "Hello world"
  779.                     #endif
  780.  
  781.  #undef <macroname>
  782.  ------------------
  783.  Un-defines a macro.
  784.  
  785.  
  786.  Script-file processor
  787.  ---------------------
  788.  Whereas the preprocessor is used when the script-file is loaded into
  789.  memory, the script-file processor is used when the parser reads a line
  790.  from the file in memory.
  791.  
  792.  Lines starting with the character ':' are executed by the script-file
  793.  processor, rather than being parsed by the parser.
  794.  
  795.  The script-file processor recognises the following statements and
  796.  keywords:
  797.  
  798.  :for <variable> = <expression> to <expression>
  799.  :next
  800.  
  801.  :if <expression>
  802.  :endif
  803.  
  804.  :print "string"
  805.  
  806.  :print <expression>
  807.  
  808.  Variables can be declared and assigned values using the following
  809.  syntax:
  810.  :var <variable> [,<variable>]
  811.  :<variable> = <expression>
  812.  :<variable> += <expression>
  813.  :<variable> -= <expression>
  814.  :<variable> *= <expression>
  815.  :<variable> /= <expression>
  816.  
  817.  Variablenames have the following restrictions:
  818.           * max 15 chars
  819.           * must start with a letter (A..Z or a..z) or '_'
  820.           * may only include letters, digits and '_'
  821.  
  822.  Variables must be declared (using ':var <variable>') before they can
  823.  be used. The exception is the variables used for :for .. :next  loops.
  824.  The loop-variable is created automatically and ceases to exist when
  825.  the loop has finished.
  826.  
  827.  
  828.  Whenever you specify a value in eg. a matrix or shape-definition etc.,
  829.  you may use an expression instead; expressions are terminated by
  830.  a space or when there are the same number of ( and ) in an expression;
  831.  thus
  832.           x*12+43             is legal
  833.           x*12 + 43           is illegal
  834.           (x*12 + 43)         is legal
  835.  
  836.  The following functions and operators are available:
  837.  
  838.                     + - * /
  839.  
  840.                     sin(<expression>)
  841.                     cos(<expression>)
  842.                     tan(<expression>)
  843.                     log(<expression>)
  844.                     exp(<expression>)
  845.                     abs(<expression>)
  846.                     sqr(<expression>)
  847.                     rnd(<expression>)
  848.  
  849.  Comparisons        ==   <=   >=   !=   <   >  &&  ||
  850.  
  851.  The comparisions will return 1 if true or 0 if false.
  852.  
  853.  Notice that expressions are evaluated using floating point, but the
  854.  value returned is always an integer.
  855.  
  856.  The variable 'frameno' always contains the number of frames defined
  857.  so far; the variables 'framesizex' and 'framesizey' are set when the
  858.  parser encounters a 'FrameArea { }' tag.
  859.  
  860.  
  861.  The following example demonstrates how to use loops and expressions:
  862.  
  863.   #define FRAMES     4
  864.  
  865.   :for i = 1 to FRAMES
  866.     PlaceObject {
  867.       depth i+1
  868.       id CIRCLE_ID
  869.       matrix { 23000*i+4560 } // one value -> scaling
  870.     }
  871.   // do something here...
  872.   :if i == 2
  873.   // do something here
  874.   :endif
  875.   :next
  876.   ShowFrame { }
  877.  
  878.  
  879.  Missing features, known bugs, etc.
  880.  ==================================
  881.  * not all features have been tested
  882.  
  883.  
  884.  Creating fonts etc.
  885.  ===================
  886.  The directory !Flash.Tools contains a few command-line tools that may
  887. be useful.
  888.      * Draw2Flash   creates library-files or full script-files
  889.                     from Draw files
  890.      * MakeFont     creates library-files from an outline font
  891.      * readflash    deconstructs a Flash file
  892.  
  893.  
  894.  Draw2Flash
  895.  ----------
  896.  Syntax:   *Draw2Flash [switches] <drawfile> <scriptfile>
  897.  Switches: -v        verbose
  898.            -s        split grouped paths
  899.            -c        center objects around 0,0
  900.            -full     output full scriptfile
  901.            -id <id>  id of first objects
  902.  Example:  *Draw2Flash -s -c -id 400 -full $.drawfile $.script
  903.  
  904.  
  905.  MakeFont
  906.  --------
  907.  Syntax:   *MakeFont [switches] <fontname> <id>
  908.  Switches: -v        verbose
  909.            -nosave   don't save anything
  910.  Example:  *MakeFont -v Homerton.Medium 50230
  911.  
  912.  You should add the name/id of the font to the file
  913.                      !Flash.Library.Fonts.IDs
  914.  Notice that some fonts may need manual adjustment afterwards.
  915.  
  916.  
  917.  readflash
  918.  ---------
  919.  Syntax:   *readflash [switches] <flashfile>
  920.  Switches: -t        display only tag-id/size
  921.  
  922.  
  923.  History
  924.  =======
  925.  
  926.  0.10     2000-06-04
  927.           * support for DefineSound and PlaySound
  928.           * improved Draw2Flash
  929.           * tidied a few things
  930.  
  931.  0.09     2000-04-25
  932.           * minor cosmetic changes
  933.           * improved the bezier-conversion in Draw2Flash and MakeFont
  934.  
  935.  0.08     2000-04-24
  936.           * tidied the handling of the dictionary
  937.           * fonttext.c now calculates and writes the no. of bits
  938.             required to store a glyph-index and advance-value
  939.           * now always includes a matrix in PlaceObject - the GPL
  940.             player appears to require this
  941.  
  942.  0.07     2000-04-21
  943.           * improved the script-processor
  944.           * implemented bracket-matching in expressions
  945.  
  946.  0.06     2000-04-20
  947.           * tidied a few things
  948.           * fixed serious bug in shape.c
  949.           * the bit-bucket is now being flushed before writing
  950.             a matrix or cxform
  951.           * aliases for selectfillstyle0 and selectfillstyle1
  952.  
  953.  0.05     2000-04-19
  954.           * fixed a few bugs in evaluate.c and preprocess.c
  955.           * aliases for DefineShape, PlaceObject, RemoveObject and
  956.             BackgroundColour
  957.           * cxform's are now parsed correctly
  958.  
  959.  0.04     2000-04-18
  960.           * :for .. next loop extended to allow expressions
  961.           * added :print to the script-processor (for script-debugging)
  962.           * added -pl commandline switches (for script-debugging)
  963.           * fixed bug in the parsing of 'moveby { }'
  964.           * added 'moveto { }' to shape-structures
  965.           * allowed RGBA values to be specifed as { R G B A }
  966.           * changed 'letter' field in glyph-structure to 'char'
  967.           * added more helpful error-messages
  968.  
  969.  0.03     2000-04-17
  970.           * added support for buttons
  971.           * added support for fonts/text (not sure if it works 100%)
  972.           * script-processor added
  973.           * now allows multiple line/fillstyles in a single structure
  974.           * automatically calculates the bbox of shapes
  975.           * objects may be placed in and removed from previous frames
  976.           * tidied the code
  977.  
  978.  0.02     2000-04-09
  979.           * first release
  980.