Table of Contents

 

7.1 MML Reference
 
 This section describes the Turbine Media Markup Language (MML) tags.

 

 

 

This chapter describes all the available Turbine MML tags. The tags are listed both alphabetically and in tag groups. Tags specific the <Text> tag can be used for text formatting. Please take some time to review the common attributes which are supported by all the visible tags.
Tag attributes marked with a * are mandatory for such tag. Color attributes can either be in the common HTML color form #RRGGBB or in the form #AARRGGBB, where AA is an extra alpha component.

Turbine supports the common XML features like character escapes, XML comments and CDATA sections. Tag attributes can be enclosed in "..." (double-quotes) or '...' (single-quotes), which is very handy for creating MML from scripting environments like ASP scripts. Although the XML parser is quite tolerant to mismatches like unclosed tags, XML correctness is, of course, strongly advised.

Turbine variables can be freely used anywhere, for example:

<Image src="{location}"/>

On places where the expanded variable value may contain characters like < or > that can cause problems with the XML parser, the {&var} syntax can be used, which will cause the expanded variable value to be properly XML-escaped. For example:

<Text>{&TextValue}</Text>

Any tag errors are listed with the offending line number, for easier and faster problem detection.

Coordinates are expressed in a system where larger Y values go down the screen:

 

Alphabetical Tag List

 


Tag Groups

 General Tags:

 

 Shape Tags:

 

 Button Tags:

 

 Display and Control Tags:

 

 Command Tags:

 

 Data Tags:

 


Text Tags

The following tags are used for text formatting inside <Text>...</Text> tags:

Tag Description
<Font face="fontFace" size="fontSize"
style="bold, italic"
color="#AARRGGBB"> ... </Font>
Defines a new font style and/or size to use on the enclosed tags
<b>...</b> Display enclosed text in bold
<i>...</i> Display enclosed text in italic
<p align="left | center | right | justify" spacing="characterSpacing" leading="lineLeading"> ... </p> Start a paragraph containing the enclosed text
<br/> Do a line break
<Pre> ... </Pre> Emit the enclosed text as-is, respecting all white-space characters

 


<Place> Common Attributes

All the tags that create visible elements, like for example the Image, Text, Shape, MovieClip and Button tags, accept a common set of very useful tag attributes:

Attribute Description
pos="x,y" The position where the element appears, in pixels
depth="depthOrder" The depth where the element will be placed. Increasing depth numbers display above prior depth values. Every element should appear on its own depth. Depth alias names can also be used instead of numeric values.
If used in Create or Load interface commands, depths are local to the MML block
scale="s" - or- scale="sx,sy" A scaling factor (or separate x and y scaling factors) to apply to the element
size="width,height" -or-
size="width," -or-
size=",height" -or-
size="10%,10%" -or-
size="10%"

If one of the values is missing, it means that Turbine will calculate the other value, to maintain original proportions.
A percentage sign means the resulting size is a percentage relative to the native size.
The size attribute is only valid for graphic objects.

angle="a" A rotation to apply over the element
matrix="sx,sk0,sk1,sy,x,y" Alternatively to using pos, scale and angle, an affine transformation matrix can be applied to the element
placepoint="center, left, top, right, bottom, origin" This attribute specifies what location on the object should the pos attribute use. For example if selecting placepoint="center", the element will be placed with its center at the coordinates specified on the pos attribute
alpha="a"

A transparency setting for the element, from 0 (full transparent) to 100 (full opaque).

Transparency is not currently supported when generating to PDF.

brightness="-100->+100" Applies a brightness effect into the element. Accepts values from -100 (negative numbers will darken the element) to +100 (positive numbers will brighten the element)
tint="#RRGGBB:level" Applies a tint effect to the element, specified by the #RRGGBB color and by a level percentage number from 0 to 100 (none to full effect)
instance="instanceName"

Specifies an instance name for this object, that can be used from client-side scripting (Action Script) to access and manipulate the object.

Scripting will be discarded when generating to PDF.

id="elementId" Setting this attribute defines a unique id for the element. The same element can be placed several times with the <Place id="elementId"> tag.
flags="define"

Setting this flags attribute together with the id attribute will not actually display it but rather define the element, to later be placed any number of times with the <Place id="elementId"> tag

background="#aarrggbb"
-or-
background="[color(#aarrggbb)], [border(#aarrggbb,width)], [space(extra)]"
-or-
background="[color(#aarrggbb)], [border(#aarrggbb,width)], [space(left,top,right,bottom)]"

Display a background rectangle, behind the placed element. The color and border sub-attributes describe the fill color and the border color, while the spacing describes the extra or actual spacing between the element's bounds and the background.

 


Tag Reference

<Arc>

 
Displays an arc with a certain center and angle. Uses the current line and fill styles. Used inside a Shape tag.

<Arc  center="x,y"
  startAngle="s"
  endAngle="e"
  size="width,height" -or- radius="hRadius,vRadius"
  scale="sx,sy" />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<ArcTo>

 
Displays an arc with a certain center and angle, starting from the current position. Uses the current line and fill styles. Used inside a Shape tag.

<ArcTo  center="x,y" *
  startAngle="s" *
  endAngle="e" *
  size="width,height" -or- radius="hRadius,vRadius" *
  scale="sx,sy" />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<Audio>

 
Integrate external audio such as WAV, MP3, FLV, AVI and QuickTime audio.

<Audio  src="location" *
  id="name"
  type="start, event, stop, stream"
  fx="loop(num)"
  encoding="raw,
          adpcm(verylow, low, med, high),
          mp3"
  event="Press|Release|RollOut|RollOver"
  />

Remarks

The Audio tag can integrate audio from the following formats:

  • WAV files (uncompressed)
  • MP3 files (with 11khz, 22khz and 44khz sampling rates)
  • AVI format
  • QuickTime format (the QuickTime runtime must be installed)
  • FLV format (except FlashComm-encoded Nelymoser 8 khz)

Please have the following characteristics or limitations in mind when encoding audio, most of them derived from running on a web server environment:

  • The required audio codecs for AVI or QuickTime must be installed on the machine where Turbine runs - when in doubt over this try to play the video on Media Player or QuickTime player.
  • MP3 and FLV movies are the fastest to be audio-encoded, followed by WAV files; AVI and QuickTime will consume larger system resources.
  • Due to QuickTime SDK limitations, QuickTime audio cannot be encoded in parallel, rather it is sequenced by Turbine.
  • Audio encoding can be a resource-intensive process (although not as much as video encoding), with all the related consequences - for example if running from a web server, the default page timeout (which can be set) can be reached.

 
The following options and quality settings are available on the encode attribute:

Value Description
raw,
adpcm(verylow, low, med, high),
mp3
The encoding quality, either raw samples (that is without compression), or ADPCM compression with one of the possible quality settings.
Turbine does not perform MP3 encoding, which will only be used if the original audio already includes audio on this format

The type attribute can have one of the following values:

Type Meaning
Stream
Audio will be encoded so that it streams with the encoded movie - e.g. it will plays as soon as possible after arriving to the player. All other types are not streamed
Start
Even if the same audio (with the same src attribute) is still playing, a new instance will start to play at this tag
Event
If the same audio (with the same src attribute) is still playing, a new instance will not start to play at this tag
Stop
Stop all audio playing with this src.

With the fx attribute a number of loops to play the audio can be specified.

The event attribute may be used inside buttons only. On this case, the following events are possible, depending on the mouse interaction with the button:

Event State Transition
Press
Over with mouse up to Over with mouse down
Release
Over with mouse down to Over with mouse up
RollOver
Outside to Over state, with mouse up
RollOut
Over to Outside state, with mouse up

This tag may also be used under the name <Sound>.

Media Output:

Flash. Audio is not exported to PDF.

 

<AutoLayout>

 
Defines how elements without a specified position (e.g. without the pos attribute) will be automatically placed.

<AutoLayout  pos="x,y"
  type="horizontal | vertical | off" *
  align="left | top | center | bottom | right"
  spacing="s" />

Remarks:

The type attribute can be one of:

Type Attribute Description
Vertical Elements will be placed in a vertical sucession, along a vertical column
Horizontal Elements will be placed in an horizontal sucession, along an horizontal row
Off AutoLayout is disabled, element positions default to the origin (0,0)

When using Vertical or Horizontal types, we can align the elements column or elements row, with the align attribute, using the usual left, right or center alignments.

Media Output:

Flash and PDF.

 

<AutoImage>

 
Displays a series of images driven by a Turbine DataSet.

<AutoImage  dataSet="dataSetName" *
  defaultSrc="imageLocation" -or-
defaultId="imageId"
  defaultDx="horizontalMove"
  defaultDy="verticalMove"
  cols="numCols"
  defaultPlacePoint="center | left | top | right | bottom" />

Remarks:

The driver DataSet can have the following columns - note that any specified tag attributes already define default values for some of these columns - in any case, default values are used if not specified:

DataSet
Column Name
Description
_src
   -or-

_id
either a location (_src column) or an id (_id) of an image to place; if not specified, the defaultSrc/defaultId attribute value will be used instead
_instance an instance name that the displayed image will use
_x an x position where the image will be placed; otherwise, automatic corrdinates will apply
_y a y position where the image will be placed; otherwise, automatic corrdinates will apply
_width a width value for the image
_height an height value for the image
_scalex an horizontal scale factor
_scaley a vertical scale factor
_angle an angle to rotate the image, specified in degrees
_alpha a transparency value, specified in a percentage
_placepoint the point in the image used for the placing position

The contents of any other DataSet column names are mapped into Flash Action Script variables defined inside each placed image.

The AutoImage tag can work in two modes, in respect to the placement coordinates:

  • with an automatic cursor - this mode is useful for horizontal/vertical image lists and grids
  • with coordinate values specified on the DataSet - this mode is more suitted for applications like images on maps, where coordinates are not structured.


On the automatic cursor mode, with the defaultDy or defaultDy attributes, plus the cols attribute, lists or grids of images can be placed. The following combinations are possible depending on which of these attributes are set:

defaultDx defaultDY cols Description
set unset unset an horizontal image list, with each image separated by defaultDX pixels
unset set unset a vertical image list, with each image separated by defaultDY pixels
set set set a grid of images, filling each horizontal row with cols elements, spaced by defaultDx, and starting a new row after it, with a defaultDy vertical move

AutoImage also allows a new row line to be started from the DataSet by including the "_newline" string as the only value of a that DataSet row.

Media Output:

Flash and PDF.

 

<AutoMedia>

 
Creates a series of elements, as specified by a Turbine DataSet, by synthesizing their MML tags. Alternatively can place other pre-defined elements from their ids.

<AutoMedia  dataSet="dataSetName" *
  defaultTag="tagName"
  defaultAttributes="attr1='value' attr2='value' ..."
  defaultValue="value"
  valueColumn="columnName"
  defaultDx="horizontalMove"
  defaultDy="verticalMove"
  cols="numCols"
  defaultId="elementId" />

Remarks:

AutoMedia can work in two different modes, depending on whether pre-defined element ids are specified (on the DataSet or on the defaultId tag attribute) or are not specified at all. When an id is specified, instances of such id are displayed as commanded by the DataSet rows. But if ids are not specified, Turbine will try to create new elements as instructed by the DataSet and specified <AutoMedia> tag attributes.

The driver DataSet can have the following columns - note that any specified <AutoMedia> tag attributes already define default values for some of these columns; interactions between <AutoMedia> tag attributes and DataSet columns are described on this table:

DataSet
Column Name
Description
_tag the name of the element tag to place - for example text, image, audio. If not specified, the value of the defaultTag attribute is used
_value
-or-
column name specified on the valueColumn attribute
if the placed element is represented by an open tag, this column holds the value of the open tag; for example if synthesizing a <Text>letters</Text> tag, this value could have "letters".
If not specified, the defaultValue tag attribute is used, if defined
_* any DataSet columns that start by an underscore will be defined as attributes of the tag being synthesized, without the initial underscore. For example if this column is named _font, a font="value" attribute is added to the element being created on this DataSet row. In addition, any attributes specified on the defaultAttributes <AutoMedia> attribute are also added
_id an element id to display with teh attributes specified on this DataSet row
_x an x position where the element will be placed; otherwise, automatic coordinates will apply
_y a y position where the element will be placed; otherwise, automatic coordinates will apply
_dx the horizontal cursor displacement to add to current position *after* placing this element
_dy the horizontal cursor displacement to add to current position *after* placing this element
_offsetx an horizontal internal offset, with respect to current cursor position, that affects where the element is placed
_offsety a vertical internal offset, with respect to current cursor position, that affects where the element is placed

The contents of any other DataSet column names are mapped into Flash Action Script variables defined inside each placed image.

The AutoImage tag can work in two modes, in respect to the placement coordinates:

  • with an automatic cursor - this mode is useful for horizontal/vertical image lists and grids
  • with coordinate values specified on the DataSet - this mode is more suitted for applications like images on maps, where coordinates are not structured.


On the automatic cursor mode, with the defaultDy or defaultDy attributes, plus the cols attribute, lists or grids of images can be placed. The following combinations are possible depending on which of these attributes are set:

defaultDx defaultDY cols Description
set unset unset an horizontal image list, with each image separated by defaultDX pixels
unset set unset a vertical image list, with each image separated by defaultDY pixels
set set set a grid of images, filling each horizontal row with cols elements, spaced by defaultDx, and starting a new row after it, with a defaultDy vertical move

AutoMedia also allows a new row line to be started from the DataSet by including the "_newline" string as the only value of the _dx or _dy DataSet columns.

In addition, specifying a "_here" string on the _dx and _dy columns of a DataSet row, will cause the cursor not to automatically advance - this is very useful when composing elements on top of each other - for example creating an image with a caption and a border shape.

Media Output:

Flash and PDF.

 

<AutoMovieClip>

 
Displays a series of movie clips, driven by a Turbine DataSet.

<AutoMovieClip  dataSet="dataSetName" *
  defaultId="movieClipId"
  defaultDx="horizontalMove"
  defaultDy="verticalMove"
  cols="numCols"
  defaultPlacePoint="center | left | top | right | bottom" />

Remarks

The driver DataSet can have the following columns - note that any specified tag attributes already define default values for some of these columns - in any case, default values are used if not specified:

DataSet
Column Name
Description
_id the id of a movie clip to display; if not specified, the defaultId attribute value will be used instead
_instance an instance name that the displayed movie clip will use
_x an x position where the movie clip will be placed; otherwise, automatic coordinates will apply
_y a y position where the movie clip will be placed; otherwise, automatic coordinates will apply
_width a width value for the movie clip
_height an height value for the movie clip 
_scalex an horizontal scale factor
_scaley a vertical scale factor
_angle an angle to rotate the movie clip, specified in degrees
_alpha a transparency value, specified in a percentage
_placepoint the point in the movie clip used for placing position

The contents of any other DataSet column names are mapped into Flash Action Script variables defined inside each placed movie clip.

The AutoMovieClip tag can work in two modes, in respect to the placement coordinates:

  • with an automatic cursor - this mode is useful for horizontal/vertical lists and grids
  • with coordinate values specified on the DataSet - this mode is more suitted for applications like hot-spots on maps, where coordinates are not structured.

 
On the automatic cursor mode, with the defaultDy or defaultDy attributes, plus the cols attribute, lists or grids of movie clips can be placed. The following combinations are possible depending on which of these attributes are set:

defaultDx defaultDY cols Description
set unset unset an horizontal movie clip list, with each movie clip separated by defaultDX pixels
unset set unset a vertical movie clip list, with each movie clip separated by defaultDY pixels
set set set a grid of movie clips, filling each horizontal row with cols elements, spaced by defaultDx, and starting a new row after it, with a defaultDy vertical move

AutoImage also allows a new row line to be started from the DataSet by including the "_newline" string as the only value of a that DataSet row.

Media Output:

Flash and PDF.

 

<BaseDepth>

 
Sets a base depth, causing elements placed inside or after this tag to be grouped in terms of their depth. By using different BaseDepth commands one can guarantee that groups of elements will always be above other groups of elements.

<BaseDepth  depth="d" * >

Remarks:

Can be used hierarchically as open tag, or sequentially as a closed tag.

Media Output:

Flash and PDF.

 

<Button>

 
Creates a button or hot-spot element.

<Button type="push|push" >

<State type="..."> ... </State>
...
<Script event="..."> ... </Script>
...
<Audio event="..." ...>
 

</Button>

Remarks

Button elements can be used to create clickable hot-spots for anything from normal buttons to dragging areas and a lot more.
The type attribute specifies how the button will behave:

  • With push type the mouse is captured, all events are sent to the button, for example clicking on a push button and dragging outside will still affect the button.
  • With menu type, as soon as the mouse cursor leaves the button area it is ignored by the button, which returns to its normal state.

See the included tags below for more information:

Can Include

State , Script and Audio tags

Media Output:

Flash and PDF. Buttons are outputted to PDF by showing only its "up" state. Associated audio and script are not exported.

 

<Chart>

 
 
If you're looking into generating impressive animated and interactive Flash charts, please see Rich Chart Server.

Displays a chart from the values contained in a Turbine DataSet.

<Chart  type="chartType" *
  dataSet="dataSetName" *
 

labelColumn="columnName" *

 

valueColumn="columnName"

 

urlColumn="columnName"

 

tooltipColumn="columnName"

 

colorColumn="columnName"

  bounds="width,height"
 

defaultColor="#AARRGGBB"

  yPrecision="decimalPlaces"
  yMarks="numMarks"
  yMin="yAxisMinValue"
  yMax="yAxisMaxValue"
 

drawBackground="true | false"

 

threeDDepth="3d_depth"

 

threeDAngle="3d_angle"

  flags="dataSetColumnVars" />

Remarks:

The type attribute can be one of:
- Area
- Area3d
- Column
- Column3d
- CoolColumn
- Glass
- Line
- Line3d
- LineMarker
- Pie
- Pie3d
- Plain
- Scatter
- Stick
- Triangle
- Triangle3d

Chart types are built in a plug-able way - you can build your own by writing the respective MML definition files.
Custom chart types must be copied into the /chart directory inside the Turbine installation directory.

Several charts can be layered by placing at the same position several <Chart> tags with the drawBackground attribute set to false, with the bottommost <Chart> tag having drawBackground set to true, to display the chart background.

To control the size of the whole chart, the size common attribute can be used, however when layering chart commands with the drawBackground attribute, the bounds attribute should be used instead, to specify the width and height of the chart's main area, so that successive charts placed above each other match perfectly.

Setting the flags attribute to "dataSetColumnVars" will cause values for each DataSet cell value inside the DataSet row being draw to be defined as Turbine variables with the names of their respective columns. This can be used inside the bar.txt chart definition file to perform extra processing for each chart bar. For similar purposes, if this attribute is specified, a Turbine variable named {_rowIndex} will also be defined for each chart bar, containing the number of the DataSet row currently being draw.

Media Output:

Flash and PDF. Interactivity of PDF charts is not available such as links, sounds and rollovers.

 

<Circle>

 
Draws a circle using the current line and fill styles. Used inside a Shape tag.

<Circle  center="x,y" *
  radius="r" -or- diameter="d" * />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<Curve>

 
Displays a curve from a number of on-line and off-line (control) points using the current line and fill styles. Used inside a Shape tag.

<Curve  type="quadratic | bezier"
  path="x0,y0; x1,y1; x2,y2..." * />

Remarks:

If the type attribute is not specified, curve type defaults to quadratic.
Quadratic curves are specified by one on-line point, followed by an off-line control point, followed by an on-line point and so on.
Bezier curves must be specified by an on-line point, followed by two control points, followed by an on-line point, then two control points and so on.

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<CurveTo>

 
Displays a curve from a number of on-line and off-line (control) points, where the initial on-line point is the current cursor position. Uses the current line and fill styles. Used inside a Shape tag.

<CurveTo  type="quadratic | bezier"
  path="x1,y1; x2,y2..." * />

Remarks:

If the type attribute is not specified, curve type defaults to quadratic.
Quadratic curves are specified by one on-line point (on this tag this point is not specified on the path attribute, instead it's assumed to be the current cursor position), followed by an offline control point, followed by an on-line point and so on.
Bezier curves must be specified by an on-line point (on this tag this point is not specified on the path attribute, instead it's assumed to be the current cursor position), followed by two control points, followed by an on-line point, then two control points and so on.

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<DataSet>

 
Loads or creates a Turbine DataSet. Can load from local disk or a remote HTTP location. DataSets can be in XML or simple line-based format.

To load a Turbine DataSet:

<DataSet  dataSet="dataSetName" *
  src="location" *
  rowTag=""
  columnTags="" />

To directly create a Turbine DataSet, an open tag should be used:

<DataSet  dataSet="dataSetName" *
  rowTag="rowTag"
  columnTags="columnTag,columnTag,..." >
  ...
</DataSet>

Remarks:

Turbine DataSets, both from a file or directly on the MML (using the open form of the tag) can be expressed either in XML or in a line-based format. When loading or creating a DataSet from an XML document, the rowTag and columnTags attributes must be used:

rowTag is the name of the XML tag to use to start a new DataSet Row - it must be a non empty tag, with other tags inside, to be used for the rows,
columnTag is a comma separated list of tags and/or tag parameters to use (once parsing inside a rowTag tag) to create DataSet columns. To address all the expressiveness of XML these formats can be used on this attribute:

columnTags Effect
"" (empty) The text immediately after the start of each rowTag will be used for the only column in the DataSet, this column will be named after the rowTag name
"tag1, tag2, tag3,..". The DataSet will feature the specified columns, composed by the text immediately inside each of these tags, for each rowTag
"tag1#attr1, tag2#attr2"

Each tag marked with an hash will contribute with the text of the attr1 or attr2 attribute inside the respective tag, for example:
<tag1 attr1="some"/> <tag2 attr2="times"/>
would use the text "some" and "times" for successive columns inside the created DataSet. The created DataSet columns would be called "tag1#attr2" and "tag2#attr2"

"tag1#attr1=alias1, tag2#attr2=alias2" Just like the above, but the columns will be defined on the DataSet with the column name specified in alias1 and alias2. This is important for some tags that depend on column names like the AutoMedia, AutoImage or AutoMovieClip tags

Turbine DataSets can also be created from a simple, line-based tabular format - the first line must contain the column names, separated by commas and enclosed in < ... , while the next lines should contain comma-separated quoted values for each of those columns. An example of a DataSet expressed in this way would be (extra spaces for easier visualization only):

<name,             address,           age>
"John Doe",        "Street Nine 7",   41
"Carl Zundapp",    "Naples Blvd 15",  17
"Maria Callahari", "Progress St. 03", 32

When loading DataSets from an external file or remote HTTP location, files can be encoded in ASCII, UTF-8 and Unicode (both little-endian and big-endian) file formats.

Media Output:

Flash and PDF.

 

<DefaultText>

 
Sets the default text attributes that will be used from this point on.

<DefaultText  font/face="fontName"
  fontSize/size="size"
  fontStyle/style="bold | italic"
  color="#AARRGGBB"
  align="left | right | center | justify"
  leading="lineLeading"
  spacing="characterSpacing"/>

Media Output:

Flash and PDF.

 

<Ellipse>

 
Draws an ellipse using the current line and fill styles. Used inside a Shape tag.

<Ellipse  center="x,y" *
  size="width,height" -or- radius="xRadius,yRadius" *
  scale="sx,sy" />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<FillBitmap>

 
Select a bitmap-type fill to be used inside a Shape tag.

<FillBitmap  side="left | right"
 

src="location" -or- *
id="imageId"

  type="clipped | tiled"
  mapbox="pos(x,y),
        size(width,height),
        angle(a)"
  resample="width,height" -or-
resample="10%,10%" -or-
resample="10%"
  fx="alphaColor(alphaValue0->255,#color)
    smooth(0->1000)
    gray
    blackwhite(0->255)"
  encoding="jpeg | zlib | native"
  encodingQuality="quality" />

Remarks:

The type attribute specifies how the fill will behave on areas mapped to outside the bitmap. If clipped is specified, the neares row or column of bitmap pixels is repeated; if tiled is specified, the bitmap will repeat it self as needed, giving a tile effect.

The mapbox attribute specifies how will the bitmap be applied to the shape filled areas - that is how to map from the image rectangle to the shape areas being filled. It works by describing the position, size (inside the shape) and rotation of a box into which the bitmap maps. This is accomplished with the mapbox attribute sub-parameters:
 - pos(x,y) are the coordinates of the top-left corner of the box
 - size(width,height) specifies the width and height of the box
 - angle(a) is an eventual box rotation
By using this attribute, filled areas can be tuned to match the used bitmap.

The resample attribute specifies how the original image can have its resolution changed, for example to save bandwidth - percentage values are in relation to the original image dimensions.

The fx attribute applies one or more effects to the image:
 - alphaColor sets the alpha (as a percentage) of pixels with the specified color.
 - smooth applies a smoothening or blur effect to the image, with the specified level.
 - gray creates a grayscale version of the image.
 - blackwhite creates an image in black and white, rulled by the specified threshold.

The encoding attribute specifies how will the image be encoded on the output media:
 - jpeg means in a lossy way, with quality controlled by the encodingQuality attribute.
 - zlib means the image will be encoded in a lossless way, similar to PNG or GIF images.
 - native means Turbine should try to leave the image encoded in its original format (if the output media allows it to), to prevent quality loss on images with an original lossy compression (currently only JPEG images).

The encodingQuality attribute sets the quality of images encoded with the jpeg encoding attribute. A percentage from 0 to 100, with the same meaning as JPEG file quality settings.

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<FillClear>

 
Clears the active fill style - areas will not be filled past this tag. Used inside a Shape tag.

<FillClear/>   

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<FillColor>

 
Select a solid color fill, inside a Shape tag.

<FillColor  side="left | right"
  color="#AARRGGBB" * />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<FillGradient>

 
Selects a gradient color fill type to be used inside a Shape tag.

<FillGradient  side="left,right"
  type="linear | radial"
  control="0%=#AARRGGBB,
         50%=#AARRGGBB,
         100%=#AARRGGBB" *
  mapbox="pos(x,y),
        size(width,height),
        angle(a)"
  />

Remarks

The type attribute specifies whether the fill is a linear left-to-right gradient or a radial , circular gradient, radiating from the center. Both types of gradient fill happen inside a rectangle that is then mapped into the shape filled areas.

The control attribute specifies a series of  position/color pairs to describe the color points involved in the gradient, up to a maximum of 8 color points. The position is expressed as a percentage that, depending on the gradient type:
 - on linear gradients, specifies the left-to-right positino, where 0% is the left-most and 100% is right-most position.
 - on radial gradients, 0% is the center of the circle, while 100% is the out-most possible position.

The mapbox attribute specifies how will the gradient be applied to the shape filled areas - that is how to map from the gradient rectangle/circle to the shape areas being filled. It works by describing the position, size (inside the shape) and rotation of a box into which the gradient maps. This is accomplished with the mapbox attribute sub-parameters:
 - pos(x,y) are the coordinates of the top-left corner of the box
 - size(width,height) specifies the width and height of the box
 - angle(a) is an eventual box rotation
By using this attribute, filled areas can be tuned to match the composed gradient.

Appears Inside:

Shape

Media Output:

Flash and PDF. Currently gradients are not supported when exporting to PDF. Instead an average of the gradient colors is applied to the shape.

 

<Frame>

 
All the elements inside a Frame tag display at the same time. This tag can be used to create animation.

<Frame>   
  ...
</Frame>  

Appears Inside:

Anywhere on main scope or inside a MovieClip tag.

Can Include

Any other tags.

Media Output:

Flash and PDF. Flash frames are translated to PDF pages - when generating to PDF, there will be a new page for each frame in the main timeline of the input media.

 

<Image>

 
Display an image.

<Image  src="location" *
 

size="width,height" -or-
size="width," -or-
size=",height" -or-
size="10%,10%" -or-
size="10%"

 

resample="width,height" -or-
resample="10%,10%" -or-
resample="10%"

 

fx="alphaColor(alphaLevel,#RRGGBB)
    smooth(0->1000)
    gray
    blackwhite(0->255)"

 

encoding="jpeg,zlib,native"

  encodingQuality="quality" />

Remarks

Although the size attribute can control the displayed size of the image, the image is still displayed at its original internal resolution. With the resample attribute, the image can have its resolution changed, for example to save bandwidth.

The fx attribute applies one or more effects to the image:
 - alphaColor sets the alpha (as a percentage) of pixels with the specified color.
 - smooth applies a smoothening or blur effect to the image, with the specified level.
 - gray creates a grayscale version of the image.
 - blackwhite creates an image in blan and white, rulled by the specified threshold.

The encoding attribute specifies how will the image be encoded on the output media:
 - jpeg means in a lossy way, with quality controlled by the encodingQuality attribute.
 - zlib means the image will be encoded in a lossless way, similar to PNG or GIF images.
 - native means Turbine should try to leave the image encoded in its original format (if the output media allows it to), to prevent quality loss on images with an original lossy compression (currently only JPEG images).

The encodingQuality attribute sets the quality of images encoded with the jpeg encoding attribute. A percentage from 0 to 100, with the same meaning as JPEG file quality settings.

Media Output:

Flash and PDF.

 

<Include>

 
Include elements from a .swf or MML file but don't display them. Included elements can then be used through the <place id="id"> tag.

<Include  src="location" * />

Media Output:

Flash and PDF.

 

<InjectData>

 
Feeds data stored in a DataSet to the component identified by instance.

<InjectData  dataset="DataSetName" *
  instance="instanceTargetName" *
  id="targetID" />

Remarks:

This tag will inject a number of rows and columns from a DataSet into a Flash component. The tag adapts to the nature of the component to specify the data in the right manner, usually by using the component's setDataProvider method.
The DataSet must have its columns named after the names that the component expects to receive on the setDataProvider. For example to inject values into a common ListBox component, which expects label and data to be defined through the setDataProvider, simply use "label" and "data" as the DataSet column names - each row of the Turbine DataSet will create a list box line with the values specified on that DataSet.
The optional id attribute can specify the id of the destination component which might be necessary if Turbine can't figure out the component's id from the instance attribute (on which case an error message is issued).

Media Output:

Flash. Flash components are not exported to PDF.

 

<Label>

 
Defines a label for the current frame.

<Label  name="labelName" * />

Remarks:

A label defined in this manner can be used in <Script> blocks to make player execution jump into the frame where the label is defined - for example:

<Script>
  gotoAndPlay("labelName");
</Script>

Media Output:

Flash. Flash scripts are not exported to PDF.

 

<Line>

 
Used inside a Shape tag, this tag draws one or more straight lines passing through the given points. Uses the current line style.

<Line  path="x0,y0; x1,y1; x2,y2..." * />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<LineStyle>

 
Select a line style to use on next shape tags. Used inside a Shape tag.

<LineStyle  width="w"
  color="#AARRGGBB" * />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<LineStyleClear>

 
Clears the line style - lines will not be appear after this tag. Used inside a Shape tag.

<LineStyleClear/>   

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<LineTo>

 
Used inside a Shape tag, this tag draws one or more straight lines from the current cursor position, through the given points. Uses the current line style.

<LineTo  path="x1,y1; x2,y2..." * />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<Mask>

 
Masks all contained tags through a clipping shape.

<Mask  id="elementId">
  ...
</Mask>

Remarks:

The id attribute refers to a Shape tag whose filled areas will represent the visible areas of the tags contained inside a <Mask> ... </Mask> tag. The following example defines a masking shape (maskingShapeId) and uses it to mask a text block:

<!-- The flags="mask" attribute will define the shape as a masking shape -->
<Shape id="maskingShapeId" flags="mask">
  <FillColor color="#0000FF"/>
  <Rect pos="0,0" size="50,50"/>
</Shape>

<!-- Everything inside the <Mask></Mask> tag will be masked by maskingShapeId -->
<Mask id="maskingShapeId">
  <Text pos="0,0">This text will be masked by the maskingShapeId</Text>
</Mask>

Although only shapes can be used for masking, any MML element can be masked.

Media Output:

Flash. Masks are not supported in PDF output.

 

<Media>

 
Defines media characteristics like width, height or frame rate.

<Media  width="w"
  height="h"
  frameRate="fps"
  color="#RRGGBB"
  debug="yes/no"
  protect="yes/no"
  compress="0, 1 - 9"
  version="v" >
  ...
</Media>

Remarks:

The Media tag is an optional top-level tag that can specify properties of the media being generated - properties like the frame rate, native size, background color or compression settings.

Can Include:

Any other tags.

Media Output:

Flash and PDF. When generating to PDF, the frameRate and protect properties are discarded.

 

<Move>

 
Moves an element previously placed at a certain depth.

<Move  depth="d" *
  pos="x,y" />

Remarks:

Besides the pos attribute, all the common attributes can be used, like scale, angle and others.

Media Output:

Flash and PDF.

 

<MoveTo>

 
The MoveTo tag (to be used only inside a Shape tag), moves the current cursor position into the specified position.

<MoveTo  pos="x,y" * />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<MovieClip>

 
Defines a movie clip that can contain a series of frames, allowing animations or simply element grouping. A movie clip can defined either directly on its contained tags, or loaded from an external location.

<MovieClip  name="name"
  flags="merge">
  <Frame>
    ...
  </Frame>
  ...
</MovieClip>

To load a movie clip from an external .swf or MML file we'd use:

<MovieClip  name="name"
  src="location" *
  flags="nativesize" />

Remarks:

Movie clips are the basic unit of time organization, allowing elements to be sequenced across time. Movie clips provide a base where a succession of frames (through the <Frame> tag) are displayed - on these frames elements can be placed, changed or removed at will. Frames always have the same duration, which is specified by the global media frameRate (available on the {Media.FrameRate} variable).
Besides the name attribute, all the common <Place> attributes can be used, like scale, angle and others.

Can Include:

Frame and any other tags, including other movie clips as long as inner movie clips do not place outter movie clips, or an infinite loop would happen (Turbine issues an error if so).

Media Output:

Flash and PDF.

 

<Origin>

 
Defines a new coordinate origin for all the tags that appear inside or after this one.

<Origin  pos="x,y"
  delta="dx,dy" >

Remarks:

Can be used hierarchically as open tag, or sequentially as a closed tag.

Media Output:

Flash and PDF.

 

<Param>

 
Defines a parameter to use when placing a component through the Place tag.

<Place  name="varName"
  value="varValue" />

Appears Inside:

Place

Remarks:

The value attribute must be specified as valid Action Script data types.

Media Output:

Flash. Flash components are not exported to PDF.

 

<Place>

 
Places an element, referred by its id attribute.

<Place  id="elementId"
  pos="x,y"
  depth="depthOrder"
  scale="s" - or- scale="sx,sy"
  angle="a"
  matrix="sx,sk0,sk1,sy,x,y"
  placepoint="center, left, top, right, bottom, origin"
  alpha="a"
  brightness="-100->+100"
  tint="#RRGGBB:level"
  name="instanceName"
  flags="define"
  component="componentId"
  size="width,height" -or-
size="width," -or-
size=",height" -or-
size="10%,10%" -or-
size="10%" />

If placing a component (when the component attribute is used), Param tags can be used to specify component parameters, inside the Place tag (which on this case is an open tag):

<Place component="componentId">
  <Param name="varName" value="varValue"/>
  <Param name="varName" value="varValue"/>
</Place>

 
Remarks:

All these attributes except the component attribute are the common attributes. In fact, all visual tags inherit these common attributes from the <Place> tag, since all are in a sense placed elements.

To place a Flash component, the following simple steps are needed:

  • A Flash .swf file containing an instance of the component must be included with the <Include> tag or on the Interface with the Turbine.Include call.
  • The component must be placed with the <Place> tag, by using the special component attribute set to the component name as displayed on the Macromedia Flash authoring tool.
    Any component parameters can be defined with <Param> tags inside the <Place> tag - the component parameter names should be the same as used on the Macromedia Flash authoring tool.

The mappings between component and parameter names (which are the ones used on the Macromedia Flash authoring tool) and their underlying Action Script names is stored on the componentregistry.settings filename, located on the Turbine installation directory, which already includes a large number of standard component mappings. For more details see 'Using Components'

Media Output:

Flash and PDF.

 

<PublishVar>

 
Exports Turbine variables into Action Script variables, arrays or associative arrays.

<PublishVar  name="turbineVarName, turbineVarName, ..."
  array="arrayName"
  namedArray="associativeArrayName" />

Remarks:

Depending on the used attributes, variables can be published into different Action Script variable types. Assuming two Turbine variables: {var1} and {var2} with values {value1} and {value2} we'd get:

AS Variable Type Attributes used AS Equivalent
Simple variables name="var1,var2" var1="value1"; var2="value2";
Array name="var1,var2"
-and-
array="arr"
arr=new Array("value1","value2");
Associative Array (also known as Named Array) name="var1,var2"
-and-
namedArray="namedArr"
namedArr=new Array();
namedArr["var1"]="value1";
namedArr["var2"]="value2";

Note that the variable names on the name attribute should not contain curly braces { }, to avoid being expanded by the Turbine parser.

Media Output:

Flash. Scripting is not exported to PDF.

 

<PublishDataSet>

 
Exports a Turbine DataSet into Action Script variables, arrays or associative arrays.

<PublishDataSet  dataSet="dataSetName"
  array="arrayName" -or-
namedArray="associativeArrayName"
  />

Remarks:

Depending on the used attributes, the DataSet contents can be published into different Action Script variable types. Assuming a DataSet named "data" like this:

<name, address>
"John", "Str. Nine"
"Carlo", "Naples Blvd"

Depending on the used attributes, the DataSet "data" would be published as:

AS Variable Type Attributes used AS Equivalent
Simple variables   data_name_0="John"; data_address_0="Str. Nine";
data_name_1="Carlo";
data_address_1="Naples Blvd";
Array array="arr"

arr=new Array;
arr[0]=new Array;
arr[0][0]="John";
arr[0][1]="Str. Nine";
arr[1]=new Array;
arr[1][0]="Carlo";
arr[1][1]="Naples Blvd";

Associative Array (also known as Named Array) namedArray="narr" narr=new Array;
narr[0]=new Array;
narr[0]["name"]="John";
narr[0]["address"]="Str. Nine";
narr[1]=new Array;
narr[1]["name"]="Carlo";
narr[1]["address"]="Naples Blvd";

Media Output:

Flash. Scripting is not exported to PDF.

 

<Rect>

 
Draws a rectangle inside a Shape tag.

<Rect  pos="xLeft,yTop" *
  size="width,height" -or- pos1="xRight,yBottom" />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<Remove>

 
Removes an element placed at a certain depth.

<Remove  depth="d" />

Remarks:

If used in Create or Load interface commands, depths are local - a <Remove> will only work on locally placed elements.
When the depth attribute is not specified, this tag will remove all elements placed on the local MML fragment. This is useful for example for animation purposes to "clear" the stage from elements placed on previous frames.

Media Output:

Flash and PDF.

 

<Slice>

 
Displays an arc connected to its center - a slice, inside a Shape tag.

<Slice center="x,y"
  startAngle="s"
  endAngle="e"
  size="width,height" -or- radius="hRadius,vRadius"
  scale="sx,sy" />

Appears Inside:

Shape

Media Output:

Flash and PDF.

 

<Script>

 
Creates an Action Script (also know as ECMA-262 script or JavaScript) block.

<Script>   
  ...
</Script>

A script can also be loaded from an external location.

<Script  src="location" * />

And scripts can be used to specify button events:

<Script  event="Press
       Release
       RelOutside
       RollOver
       RollOut
       DragOver
       DragOut">
  ...
</Script>

Remarks:

The optional event attribute can only be used inside a Button tag, to specify actions to perform when one or more of the specified events occur. On this case, the following events are possible, depending on the mouse interaction with the button:

Event State Transition
Press
Over with mouse up to Over with mouse down
Release
Over with mouse down to Over with mouse up
RollOver
Outside to Over state, with mouse up
RollOut
Over to Outside state, with mouse up
DragOver
Outside to Over, with mouse down
DragOut Over to Outside, with mouse down
RelOutside
Outside mouse down to mouse up - available only on push-type buttons

 

Appears Inside:

Normal scope, MovieClip or Button tags.

Media Output:

Flash. Scripting is not exported to PDF.

 

<Shape>

 
Draws a shape with line and fill styles, straight and curved lines and other graphic elements.

<Shape>  
  ...
</Shape>

A shape can also be loaded from an external location (which should contain the shape's inner tags):

<Shape  src="location" * />

Remarks:

The Shape tag and its inner tags allow the drawing of shape elements, from a set of commands to set line and fill styles, draw lines and curves, or draw graphic elements like Rectangles or Circles. See the tags that can be used inside a <Shape> tag immediately below:

Can Include:

Arc, ArcTo, Circle, Curve, CurveTo, Ellipse, FillBitmap, FillClear, FillColor, FillGradient, Line, LineStyle, LineStyleClear, LineTo, MoveTo, Slice, Shape, Rect tags.

Media Output:

Flash and PDF.

 

<State>

 
Describes a button state, in a Button definition.

<State  type="up | over | down | hit">
  ...
</State>

Remarks:

Button states describe how the button will appear on the four possible states:

  • Up state is the normal, default button state.
  • Over state is when the mouse is floating over the button hit area (the Hit state).
  • Down state happens when the user clicked the button.
  • Hit state or hit area defines what is the sensible area of the button used to determine whether the mouse is floating over the button or whether it was clicked.

A button state is specified by the <State> tag, and its type attribute, which can be set to one or more of these states. All the elements placed inside a <State> will appear as the representation of that button state.

Appears Inside:

Button

Media Output:

Flash and PDF. When exporting to PDF, only the Up state will be visible.

 

<Text>

 
Displays formatted text.

<Text  font="Arial"
  fontSize="12"
  fontStyle="bold | italic"
  color="#AARRGGBB"
  leading="lineLeading"
  spacing="characterSpacing"
 

align="left | right | center | justify"

 

width="textLineWidth"

 

bounds="left,top,right,bottom; left,top,right,bottom; ..."

 

flags="preformatted,
       htmlFontSizes,
       baseline" />

  ...
</Text>

Text can also be loaded from an external location:

<Text  src="location" *
  above attributes />

Remarks:

The text tag creates static text blocks with the following options (from the above attributes), which can be defined for the whole block or down to paragraphs and individual characters:

  • font faces, styles and sizes
  • text color
  • paragraph alignment
  • line leading
  • character spacing
  • definable text flow areas

By using the bounds attribute, a number of rectangular areas can be specified, across which the text will flow. The general rule is that text will always flow from the top to the bottom, trying to fit the next available flow area.

Static text displays always displays well on different environments, even if the used fonts are not installed.

When loading from an external file or remote HTTP location, files can be encoded in ASCII, UTF-8 and Unicode (both little-endian and big-endian) formats.

See the text formatting tags for a list of the possible tags.

Media Output:

Flash and PDF.

 

<TextField>

 
Displays an editable text area.

<TextField  size="width,height" *
  font="Arial"
  fontSize="12"
  fontStyle="bold | italic"
  color="#AARRGGBB"
 

align="left | right | center | justify"

 

leading="lineLeading"

 

margins="leftMargin,rightMargin"

 

indent="indentSpacing"

 

maxLength="numCharacters"

  variable="variableName"
  outlines="characters"
 

flags="wrap,multiline,password,
readonly,autosize,noSelect,
border,html" />

  ...
</TextField>

Text contents can also be loaded from an external location:

<TextField  src="location" *
  above attributes />

Remarks:

The TextField tag can display a dynamic or editable text block - the following options can be used:

  • font faces, styles and sizes
  • text color
  • paragraph alignment
  • line vertical leading and horizontal indent and margins
  • a maximum length for editable text
  • multiline text wrapping
  • whether the text field is selectable and/or editable
  • the text field can display * characters, as a password field
  • the text field can display HTML-like tags
  • a border and background can be displayed around the text field
  • an Action Script variable can be mapped to the text field contents

When outputting to PDF, there are some limitations associated with text fields:

  • the font used in the PDF text field is always Times-Roman
  • the PDF text field font style is always regular
  • the alignment is applied globally to the text field
  • there are no line vertical leading and horizontal indent and margins
  • there is no text wrapping
  • the text field can't display HTML-like tags
  • the text will be encoded using Code Page 1252, often called the “Windows ANSI” encoding. This is the standard Windows encoding for Latin text in Western writing systems

Because of the above limitations, when outputting text to PDF, it is advisable to use static text instead of text fields whenever possible, because it is so much flexible.

The outlines attribute can contain the following values:

  • outlines="all" <- embed all character outlines in font.
  • outlines="" <- embed character outlines used on this text field.
  • outlines="123" <- embed only the specified character outlines.

 
When Unicode characters (above character 127) are used in a text field, the {Media.Flash.Version} is automatically set by Turbine to at least 6, which will cause a version 6 or higher Flash movie to be generated - this happens because the Flash player only started to support regular Unicode characters at version 6.
However if Flash 5 players must be supported and the text field only uses characters below character 256 (for example Latin-1 characters), setting {Media.Flash.Version} to 5 before generation will cause a regular Flash 5 movie to be generated with these characters correctly displayed.

Media Output:

Flash and PDF. When generating to PDF, please read the above remarks.

 

<Var>

 
Loads or creates a Turbine variables. Can load from local disk or a remote HTTP location.

To load Turbine variables from a file:

<Var  src="location" * />

To directly create Turbine variables, an open tag should be used:

<Var> 
  var=value
  var=value
  ...
</Var>

Remarks:

Variable names should not include the curly braces, only the variable name - use var = value instead of {var}=value.

When loading from an external file or remote HTTP location, files can be encoded in ASCII, UTF-8 and Unicode (both little-endian and big-endian) formats.

Media Output:

Flash and PDF.

 

<Video>

 
Integrate external video such as AVI, QuickTime, Animated GIF and FLV video.

<Video  src="location" *
  frameRate="fps"
  size="width,height" -or-
size="width," -or-
size=",height" -or-
size="10%,10%" -or-
size="10%"
  resample="width,height" -or-
resample="10%,10%" -or-
resample="10%"
  encoding="video(verylow, low, medium, high, lossless),
          noAudio,
          raw, adpcm(verylow, low, med, high), mp3"
  />

Remarks

The Video tag can integrate video from the following formats:

  • AVI format
  • QuickTime format (the QuickTime runtime must be installed)
  • Animated GIF format
  • FLV format (except FlashComm-encoded Nelymoser 8 khz audio)

Please have the following characteristics or limitations in mind when encoding videos, most of them derived from running on a web server environment:

  • The required codecs for AVI or QuickTime must be installed on the machine where Turbine runs - when in doubt over this try to display the video on Media Player or QuickTime player.
  • FLV movies are the fastest to be encoded, followed by Animated GIFs; AVI and QuickTime will consume larger system resources.
  • AVI and QuickTime have a limitation of a maximum of 16000 frames.
  • Due to QuickTime SDK limitations, QuickTime videos cannot be encoded in parallel, rather they are sequenced by Turbine.
  • Video and audio encoding quality settings are available for all formats, except for FLV videos, which are not re-encoded.
  • Encoding can be a resource-intensive process, with all the related consequences - for example if running from a web server, the default page or connection timeout (which can be set) can be reached.

In general encoding time and final file size can be improved by the following two factors:

  • Selecting a lower frame rate (less frames are encoded)
  • Selecting a lower resample size (less pixels are processed)
  • Selecting lower quality settings will lower file size

 
The following options and quality settings are available on the encode attribute:

Value Description
video(verylow, low, medium, high, lossless) Specifies the video encoding quality, with one of these settings - for example video(high). This settin is only possible for non-FLV formats, since FLV is no re-encoded
noAudio No audio should be encoded
raw,
adpcm(verylow, low, med, high),
mp3
The audio encoding quality, either raw samples (that is without compression), or ADPCM compression with one of the possible quality settings.
Turbine does not perform MP3 encoding, which will only be used if the original video already includes audio on this format

This tag supports all the default common attributes except instance.

Media Output:

Flash. On PDF each video frame appears on a separate document page (except for FLV video).

 

 

Table of Contents

 
Flash and Macromedia Flash are trademarks of Macromedia, Inc.