Products Product Support Downloads Gallery About us
 


ASP Turbine
 
Features
 
Samples
 
Download
 
Purchase
 
Documentation

 
 
   
Samples Menu

Turbine MML Sample
(Flash MX; PDF)
  

Turbine Media Markup Language is a simple XML language that can express all the rich media capabilities contained in Turbine. With MML you can display text and images, draw shapes, movie clips, buttons, video and audio, and control all of these with scripting. MML elements can be explicitly placed on a certain position or they assume sequential positions across the movie (this feature is called AutoLayout). For example the following tags display a text label above a shape and an image:

<AutoLayout type="Vertical"/>

<Text>This is a block of text</Text>

<Shape>
  <LineStyle color="#ff0000" width="5"/>
  <FillColor color="#8080ff"/>
  <Rect size="200,100"/>
</Shape>

<Image src="../common/flower.jpg"/>

<Image pos="350,50" src="../common/flower.bmp"/>
 

The above tags will display in Flash as:
 

 

And in PDF as: (a new window will open)

 

Movie Clips

Movie Clips can be used to organize or animate elements like text, images or shapes. For example the example below displays a series of text blocks across 4 frames, and also a Flash movie from an external .swf file (either from the local disk or a remote http location):

<MovieClip>
  <Frame>
    <Text>Running</Text>
  </Frame>
  <Frame>
    <Text>Running.</Text>
  </Frame>
  <Frame>
    <Text>Running..</Text>
  </Frame>
  <Frame>
    <Text>Running...</Text>
  </Frame>
</MovieClip>

<MovieClip pos="0,25" src="../common/wheelmovie.swf"/>
 

This displays in Flash as:
 

Each frame is translated to a new page when outputting to PDF. So the above example would produce a PDF document with four pages.


Buttons

Turbine MML can also create clickable buttons, with up, over and down states:

<Button pos="10,10">

  <State type="up,hit">
    <Shape>
      <LineStyle color="#404080" width="5"/>
      <FillColor color="#8080ff"/>
      <Rect size="200,100"/>
    </Shape>
    <Text pos="100,50" placepoint="center">This is the UP state</Text>
  </State>

  <State type="over">
    <Shape>
      <LineStyle color="#8080dd" width="5"/>
      <FillColor color="#ddddff"/>
      <Rect size="200,100"/>
    </Shape>
    <Text pos="100,50" placepoint="center">This is the OVER state</Text>
  </State>

  <State type="down">
    <Shape>
      <LineStyle color="#606060" width="5"/>
      <FillColor color="#808080"/>
      <Rect size="200,100"/>
    </Shape>
    <Text pos="100,50" placepoint="center" color="#ffffff">This is the DOWN state</Text>
  </State>

  <Script event="Release">
    getUrl("http://www.blue-pacific.com", "_blank");
  </Script>

</Button>
 

This displays in Flash as:
 

When outputting to PDF, only the "Up" state of the button will be visible:

 

Scripting

Powerful scripting is also included in Turbine 7, which includes an on-the-fly ECMA Script compiler. ECMA Script is known in the Flash scene as Action Script and has a simple JavaScript-like syntax. Action Script can freely interact with all the MML elements. The following example causes an image to be attached to the mouse cursor:


<Text>Move the mouse over here</Text>

<Image src="../common/flower.gif" instance="flower"/>

<Script>
  onEnterFrame = function (){
    flower._x=_xmouse;
    flower._y=_ymouse;
  }
</Script>
 

This displays in Flash as:
 

 


MML inside .swf Movies

But MML can also be integrated inside .swf movies, which allows for better, simpler positioning of elements. On this example the tags that create the above "Running..." movie clips are placed on a textfield inside this .swf movie:

After being loaded by Turbine, the MML tags on the above .swf will be executed and produce the results below. Note how the resulting elements are displayed on the position of the above Flash text field (where the MML tags were issued):
 

Samples Menu
   
 

 
Home  |  Products  |  Support  |  Downloads  |  Gallery  |  Company

Questions or comments? info@blue-pacific.com
© 2005 Blue Pacific Software, all rights reserved.
All trademarks are the property of their respective owners.