Products Product Support Downloads Gallery About us
 


ASP Turbine
 
Features
 
Samples
 
Download
 
Purchase
 
Documentation

 
 
   
Samples Menu

Scripting Sample
(Flash MX)
 

Turbine includes an on-the-fly Action Script compiler allowing for powerful scripting capabilities. Scripting can be used to control other MML tags. For example, the text on the Flash text field below is set with Action Script:
 

The Flash movie above was created from the following MML:

<TextField instance="field" size="300,100" flags="multiline,border,wrap">The next values are added by the script:
</TextField>

<Script>
  for(i=1; i<=3; i++){
    field.text = field.text + i + "\n";
  }

</Script>
 

 


Controlling MML Elements

Turbine scripting supports all the object-oriented capabilities available in Flash MX. The following example uses an onEnterFrame handler to rotate an image created by an <Image> tag:


The Flash movie above was created from the following MML Tags:

<Image instance="image" src="../common/flower.gif"
pos="300,100" size="120,80"/>

<Script>
  onEnterFrame = function(){
    image._rotation+=2;
  }
</Script>
 

 


Turbine Window Debugging

Turbine scripting can work with the Turbine window, to provide a handy trace-like functionality that works on all situations:


The Flash movie above was created from the following MML:

<Script>
  turbineDebug("This text was logged from a script block.");

  var now = new Date();
  turbineDebug("Current time is " + now.toString());

  turbineDebug("Flash Player version is: " + getVersion());

</Script>
 

  
 

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.