Project Template Syntax

From FDT Documentation

(Difference between revisions)
Jump to: navigation, search
(Libraries)
m (Reverted edits by Aklement (talk) to last revision by Mgredig)
Line 1: Line 1:
-
<div class="center"><div class="floatnone"><a href="/docs/File:Template_properties.png" class="image"><img alt="Template properties.png" src="/w/images/0/08/Template_properties.png" width="600" height="150" /></a></div></div>
+
[[File:Template_properties.png|center]]
-
<p>With FDT 4.2, the FDT team greatly expanded project templates and the syntax available in the description.xml.
+
 
-
</p>
+
With FDT 4.2, the FDT team greatly expanded project templates and the syntax available in the description.xml.
-
<h1>Template Properties</h1>
+
=Template Properties=
-
<h2>description</h2>
+
 
-
<p>Use this tag to add a text description to your template.  This will appear in the text area below the template selector. You can even add in variables into your description and update the user about the current selection.
+
==description==
-
</p>
+
Use this tag to add a text description to your template.  This will appear in the text area below the template selector. You can even add in variables into your description and update the user about the current selection.
-
<div class="center"><div class="floatnone"><a href="/docs/File:Description.png" class="image"><img alt="Description.png" src="/w/images/8/87/Description.png" width="600" height="150" /></a></div></div>
+
 
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;expressions<span class="re2">&gt;</span></span></span>
+
[[File:Description.png|center]]
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;htmlDesc&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;if(${htmlTemplate},</span>
+
 
-
<span class="sc3">'This HTML wrapper will create a simple HTML page with your SWF embedded in it.',' ')&quot;</span> <span class="re2">/&gt;</span></span>
+
<syntaxhighlight lang="xml">
-
<span class="sc3"><span class="re1">&lt;/expressions<span class="re2">&gt;</span></span></span>
+
<expressions>
-
<span class="sc3"><span class="re1">&lt;description<span class="re2">&gt;</span></span></span>
+
   <expression name="htmlDesc" value="if(${htmlTemplate},
 +
'This HTML wrapper will create a simple HTML page with your SWF embedded in it.',' ')" />
 +
</expressions>
 +
<description>
This template will create a project named '${projectName}'  
This template will create a project named '${projectName}'  
which contains only the basic libraries to develop and compile a  
which contains only the basic libraries to develop and compile a  
pure AS3 project.${newline}${htmlDesc}
pure AS3 project.${newline}${htmlDesc}
-
<span class="sc3"><span class="re1">&lt;/description<span class="re2">&gt;</span></span></span></pre></div></div>
+
</description>
-
<p><br />
+
</syntaxhighlight>
-
</p>
+
 
-
<ul><li> <i>note</i>: Use the <i>${newline}</i> keyword to create a line break in your descriptions. In the above example, if the users sets true <i>htmlDesc</i> then the additional text will be added, on a new line, to the description.
+
 
-
</li></ul>
+
 
-
<p><br />
+
* ''note'': Use the ''${newline}'' keyword to create a line break in your descriptions. In the above example, if the users sets true ''htmlDesc'' then the additional text will be added, on a new line, to the description.
-
</p>
+
 
-
<hr />
+
 
-
<h2>name</h2>
+
 
-
<p>The name of your template as it appears in the new project wizard.
+
----
-
</p>
+
 
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;name<span class="re2">&gt;</span></span></span>AS3<span class="sc3"><span class="re1">&lt;/name<span class="re2">&gt;</span></span></span></pre></div></div>
+
==name==
-
<p><br />
+
The name of your template as it appears in the new project wizard.
-
</p>
+
 
-
<hr />
+
<syntaxhighlight lang="xml">
-
<h2>version</h2>
+
<name>AS3</name>
-
<p>FDT uses this element to keep track of the version for the template in case it is to be updated.
+
</syntaxhighlight>
-
</p>
+
 
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;version<span class="re2">&gt;</span></span></span>2.0<span class="sc3"><span class="re1">&lt;/version<span class="re2">&gt;</span></span></span></pre></div></div>
+
 
-
<p><br />
+
 
-
</p>
+
----
-
<hr />
+
 
-
<h2>projectType</h2>
+
==version==
-
<p>Each template needs to have its projectType defined.  The project type is what determines which SDK &amp;.SWCs are automatically added to your source path, your runtime, player and compiler arguments.
+
FDT uses this element to keep track of the version for the template in case it is to be updated.
-
</p><p>The project types are located in the <i>projectTypes</i> folder within the <i>FDT</i> folder.
+
 
-
</p>
+
<syntaxhighlight lang="xml">
-
<div class="center"><div class="floatnone"><a href="/docs/File:Project_types.png" class="image"><img alt="Project types.png" src="/w/images/a/a3/Project_types.png" width="225" height="193" /></a></div></div>
+
<version>2.0</version>
-
<p><br />
+
</syntaxhighlight>
-
</p>
+
 
-
<h1>Variables</h1>
+
 
-
<h2>variables</h2>
+
 
-
<p>The <i>variables</i> tag is what defines templates in FDT 4.2 and later. When a template implements this element, you'll be able to create UI elements that allow you to customize your project before completion. Your template can only have one <i>variables</i> element. FDT will read the first and ignore any following <i>variables</i> elements.  
+
----
-
</p>
+
 
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;variables<span class="re2">&gt;</span></span></span>
+
==projectType==
-
   <span class="sc3"><span class="re1">&lt;primaryGroup</span> <span class="re0">label</span>=<span class="st0">&quot;Template Options&quot;</span><span class="re2">&gt;</span><span class="re1">&lt;/primaryGroup<span class="re2">&gt;</span></span></span>
+
Each template needs to have its projectType defined.  The project type is what determines which SDK &.SWCs are automatically added to your source path, your runtime, player and compiler arguments.
-
<span class="sc3"><span class="re1">&lt;/variables<span class="re2">&gt;</span></span></span></pre></div></div>
+
 
-
<p><br />
+
The project types are located in the ''projectTypes'' folder within the ''FDT'' folder.
-
</p>
+
 
-
<hr />
+
[[File:Project_types.png|center]]
-
<h2>primaryGroup</h2>
+
 
-
<p>When you create a <i>variables</i> element, you'll need to have a <i>primaryGroup</i> descendant element.  
+
 
-
Similar to <i>variables</i>, <i>primaryGroup</i> can only appear once inside of a <i>variables</i> element.
+
 
-
</p>
+
=Variables=
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;variables<span class="re2">&gt;</span></span></span>
+
 
-
   <span class="sc3"><span class="re1">&lt;primaryGroup</span> <span class="re0">label</span>=<span class="st0">&quot;Template Options&quot;</span><span class="re2">&gt;</span></span>
+
==variables==
-
     <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;addMetaData&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Add Metadata&quot;</span> <span class="re0">default</span>=<span class="st0">&quot;true&quot;</span></span>
+
 
-
<span class="sc3">      <span class="re0">type</span>=<span class="st0">&quot;boolean&quot;</span> <span class="re2">/&gt;</span></span>
+
The ''variables'' tag is what defines templates in FDT 4.2 and later. When a template implements this element, you'll be able to create UI elements that allow you to customize your project before completion. Your template can only have one ''variables'' element. FDT will read the first and ignore any following ''variables'' elements.  
-
<span class="sc3"><span class="re1">&lt;group</span> <span class="re0">label</span>=<span class="st0">&quot;Project Setup&quot;</span><span class="re2">&gt;</span></span>
+
 
-
  <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;addFla&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Add .fla&quot;</span> <span class="re0">default</span>=<span class="st0">&quot;true&quot;</span></span>
+
<syntaxhighlight lang="xml">
-
<span class="sc3"> <span class="re0">type</span>=<span class="st0">&quot;boolean&quot;</span> <span class="re2">/&gt;</span></span>
+
<variables>
-
  <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;htmlTemplate&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Include HTML Wrapper&quot;</span></span>
+
   <primaryGroup label="Template Options"></primaryGroup>
-
<span class="sc3"> <span class="re0">default</span>=<span class="st0">&quot;false&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;boolean&quot;</span> <span class="re2">/&gt;</span></span>
+
</variables>
-
<span class="sc3"><span class="re1">&lt;/group<span class="re2">&gt;</span></span></span>
+
</syntaxhighlight>
-
   <span class="sc3"><span class="re1">&lt;/primaryGroup<span class="re2">&gt;</span></span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;/variables<span class="re2">&gt;</span></span></span></pre></div></div>
+
 
-
<p><br />
+
 
-
<b>Arguments</b>:  
+
----
-
</p>
+
 
-
<ol><li><b>label</b>&nbsp;: The label description that will appear at the top of the template variables UI section within the New Flash Project Wizard.
+
==primaryGroup==
-
</li><li><b>description</b>&nbsp;: An optional description for documentation purposes.
+
When you create a ''variables'' element, you'll need to have a ''primaryGroup'' descendant element.  
-
</li></ol>
+
Similar to ''variables'', ''primaryGroup'' can only appear once inside of a ''variables'' element.
-
<ul><li><i>note</i>: Other arguments, such as 'enableIf', are ignored.
+
 
-
</li></ul>
+
<syntaxhighlight lang="xml">
-
<p><br />
+
<variables>
-
</p>
+
   <primaryGroup label="Template Options">
-
<hr />
+
     <variable name="addMetaData" label="Add Metadata" default="true"
-
<h2>group</h2>
+
      type="boolean" />
-
<p>Groups are used to organize similar variables together.  They are also used to create popup buttons that will open a new window containing more UI elements. Groups can have more groups nested within them.
+
<group label="Project Setup">
-
</p><p><br />
+
  <variable name="addFla" label="Add .fla" default="true"
-
</p>
+
type="boolean" />
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;variables<span class="re2">&gt;</span></span></span>
+
  <variable name="htmlTemplate" label="Include HTML Wrapper"
-
   <span class="sc3"><span class="re1">&lt;primaryGroup</span> <span class="re0">label</span>=<span class="st0">&quot;Options&quot;</span> <span class="re0">description</span>=<span class="st0">&quot;My Template Variables&quot;</span> <span class="re2">&gt;</span></span>
+
default="false" type="boolean" />
-
     <span class="sc3"><span class="re1">&lt;group</span> <span class="re0">label</span>=<span class="st0">&quot;Unit Testing&quot;</span><span class="re2">&gt;</span></span>
+
</group>
-
  <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;addUnitTesting&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Add Unit Testing&quot;</span></span>
+
   </primaryGroup>
-
<span class="sc3">     <span class="re0">default</span>=<span class="st0">&quot;false&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;boolean&quot;</span> <span class="re2">/&gt;</span></span>
+
</variables>
-
&nbsp;
+
</syntaxhighlight>
-
<span class="sc-1">&lt;!-- Create a popupButton that will open these UI variables in a new window --&gt;</span>
+
 
-
<span class="sc3"><span class="re1">&lt;group</span> <span class="re0">label</span>=<span class="st0">&quot;More...&quot;</span> <span class="re0">style</span>=<span class="st0">&quot;popupButton&quot;</span><span class="re2">&gt;</span></span>
+
 
-
    <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;testFolderName&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Test Folder Name&quot;</span></span>
+
'''Arguments''':  
-
<span class="sc3"> <span class="re0">default</span>=<span class="st0">&quot;test-src&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;string&quot;</span> <span class="re2">/&gt;</span></span>
+
#'''label''' : The label description that will appear at the top of the template variables UI section within the New Flash Project Wizard.
-
      <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;addExample&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Add Unit Test Example&quot;</span></span>
+
#'''description''' : An optional description for documentation purposes.
-
<span class="sc3"> <span class="re0">default</span>=<span class="st0">&quot;false&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;boolean&quot;</span> <span class="re2">/&gt;</span></span>
+
*''note'': Other arguments, such as 'enableIf', are ignored.
-
      <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;addJar&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Include flexUnitTasks.jar&quot;</span></span>
+
 
-
<span class="sc3"> <span class="re0">default</span>=<span class="st0">&quot;false&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;boolean&quot;</span> <span class="re2">/&gt;</span></span>
+
 
-
    <span class="sc3"><span class="re1">&lt;/group<span class="re2">&gt;</span></span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;/group<span class="re2">&gt;</span></span></span>
+
----
-
   <span class="sc3"><span class="re1">&lt;/primaryGroup<span class="re2">&gt;</span></span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;/variables<span class="re2">&gt;</span></span></span></pre></div></div>
+
==group==
-
<p><br />
+
Groups are used to organize similar variables together.  They are also used to create popup buttons that will open a new window containing more UI elements. Groups can have more groups nested within them.
-
<b>Arguments</b>:  
+
 
-
</p>
+
 
-
<ol><li><b>label</b>&nbsp;: The label description that will appear at the top group.
+
<syntaxhighlight lang="xml">
-
</li><li><b>description</b>&nbsp;: An optional description for documentation purposes.
+
<variables>
-
</li><li><b>enableIf</b>&nbsp;: A boolean that can disable and enable the UI variables within the group.
+
   <primaryGroup label="Options" description="My Template Variables" >
-
</li><li><b>style</b>&nbsp;: Use this to set if the group is to be a popup window. Possible values are <i>popupButton</i> and <i>hyperlink</i>.
+
     <group label="Unit Testing">
-
</li></ol>
+
  <variable name="addUnitTesting" label="Add Unit Testing"
-
<p><br />
+
    default="false" type="boolean" />
-
</p>
+
 
-
<hr />
+
<!-- Create a popupButton that will open these UI variables in a new window -->
-
<h2>variable</h2>
+
<group label="More..." style="popupButton">
-
<p>The most powerful part of project templates are the UI variables you can create. Each <i>variable</i> element you create will represent itself as an interactive UI component (e.g. text input, combo box, radio button). The value of the variable will be evaluated as you change it while configuring your template.  
+
    <variable name="testFolderName" label="Test Folder Name"
-
</p><p>If you reference the variable in any files (ActionScript,XML,JavaScript,HTML....) and you choose to process those files (within a contentCreation element) the variable will be replaced with whatever value you have assigned it.
+
default="test-src" type="string" />
-
</p><p>To reference a variable use a dollar sign and brackets, '${}', with your variable name between the brackets.
+
      <variable name="addExample" label="Add Unit Test Example"
-
</p>
+
default="false" type="boolean" />
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;variables<span class="re2">&gt;</span></span></span>
+
      <variable name="addJar" label="Include flexUnitTasks.jar"
-
   <span class="sc3"><span class="re1">&lt;primaryGroup</span> <span class="re0">label</span>=<span class="st0">&quot;Options&quot;</span><span class="re2">&gt;</span></span>
+
default="false" type="boolean" />
-
<span class="sc-1">&lt;!-- This variable is being used to determine to add Metadata or not--&gt;</span>
+
    </group>
-
     <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;addMetaData&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Add Metadata&quot;</span> <span class="re0">default</span>=<span class="st0">&quot;true&quot;</span></span>
+
</group>
-
<span class="sc3">   <span class="re0">type</span>=<span class="st0">&quot;boolean&quot;</span> <span class="re2">/&gt;</span></span>
+
   </primaryGroup>
-
<span class="sc-1">&lt;!-- This variable is being used to setup the base class of my ActionScript file. </span>
+
</variables>
-
<span class="sc-1">    In my ActionScript files'${classExtends}' will be replaced with whatever</span>
+
</syntaxhighlight>
-
<span class="sc-1"> value it is assigned here --&gt;</span>
+
 
-
<span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;classExtends&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Base Class:&quot;</span> <span class="re0">default</span>=<span class="st0">&quot;Sprite&quot;</span></span>
+
 
-
<span class="sc3">   <span class="re0">type</span>=<span class="st0">&quot;enum('Sprite','MovieClip')&quot;</span> <span class="re2">/&gt;</span></span>
+
'''Arguments''':  
-
   <span class="sc3"><span class="re1">&lt;/primaryGroup<span class="re2">&gt;</span></span></span>
+
#'''label''' : The label description that will appear at the top group.
-
<span class="sc3"><span class="re1">&lt;/variables<span class="re2">&gt;</span></span></span></pre></div></div>
+
#'''description''' : An optional description for documentation purposes.
-
<p><br />
+
#'''enableIf''' : A boolean that can disable and enable the UI variables within the group.
-
<b>Arguments</b>:  
+
#'''style''' : Use this to set if the group is to be a popup window. Possible values are ''popupButton'' and ''hyperlink''.
-
</p>
+
 
-
<ol><li><b>name</b>&nbsp;: To reuse your variable, you'll need to be able to reference it either within the template itself, or in an external file that will be processed ( variables replaced ).
+
 
-
</li><li><b>label</b>&nbsp;: What will be displayed to the users within the template GUI.
+
 
-
</li><li><b>default</b>&nbsp;: The starting value for the variable.
+
----
-
</li><li><b>type</b>&nbsp;: Use this to set the UI component (e.g. text input, combo box, radio button).
+
 
-
</li><li><b>description</b>&nbsp;: An optional description for documentation purposes.
+
==variable==
-
</li><li><b>enableIf</b>&nbsp;: A boolean that can disable and enable the variable.
+
The most powerful part of project templates are the UI variables you can create. Each ''variable'' element you create will represent itself as an interactive UI component (e.g. text input, combo box, radio button). The value of the variable will be evaluated as you change it while configuring your template.  
-
</li></ol>
+
 
-
<p>When using the <i>type</i> attribute here are some examples of UI components you can create:
+
If you reference the variable in any files (ActionScript,XML,JavaScript,HTML....) and you choose to process those files (within a contentCreation element) the variable will be replaced with whatever value you have assigned it.
-
</p>
+
 
-
<ul><li><b>enum('value 1','value 2','value 3',...)</b>: This will create a combo box or radio button set of predefined values.  The default for <i>enum</i> will be a combo box. To create radio buttons, add a <i>style=radio</i> attribute.
+
To reference a variable use a dollar sign and brackets, '${}', with your variable name between the brackets.
-
</li><li><b>color</b>: This will create a button that will display a color hex value and allow you to open the color picker.
+
 
-
</li><li><b>int('minimum value','maximum value','increment value')</b>: This will create a text input for number values based on the define range.
+
<syntaxhighlight lang="xml">
-
</li><li><b>float</b>: Creates a text input for float values.
+
<variables>
-
</li><li><b>string</b>: A text input.
+
   <primaryGroup label="Options">
-
</li><li><b>string('value 1','value 2',...)</b>: A text input with a combo box that allows for preset (but editable) values.
+
<!-- This variable is being used to determine to add Metadata or not-->
-
</li><li><b>boolean</b>: This will create a checkbox that will toggle the variable from <i>true</i> to <i>false</i>.
+
     <variable name="addMetaData" label="Add Metadata" default="true"
-
</li><li><b>file</b>: This will create a text input and browse button that will point to a specific file. There is also the option to create file filters, e.g. type="file('png','gif')"
+
  type="boolean" />
-
</li><li><b>folder</b>: This will create a text input and browse button for a specific folder. There is also the option to create file filters, e.g. type="file('png','gif')"
+
<!-- This variable is being used to setup the base class of my ActionScript file.  
-
</li></ul>
+
    In my ActionScript files'${classExtends}' will be replaced with whatever
-
<p><br />
+
value it is assigned here -->
-
</p>
+
<variable name="classExtends" label="Base Class:" default="Sprite"
-
<hr />
+
  type="enum('Sprite','MovieClip')" />
-
<h2>hyperlink</h2>
+
   </primaryGroup>
-
<p>Within group elements, you can add a hyperlink which will open your browser and navigate to a particular URL.
+
</variables>
-
</p>
+
</syntaxhighlight>
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;variables<span class="re2">&gt;</span></span></span>
+
 
-
   <span class="sc3"><span class="re1">&lt;primaryGroup</span> <span class="re0">label</span>=<span class="st0">&quot;Template Options&quot;</span><span class="re2">&gt;</span></span>
+
 
-
     <span class="sc3"><span class="re1">&lt;group<span class="re2">&gt;</span></span></span>
+
'''Arguments''':  
-
       <span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;addUnitTesting&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Add Unit Testing&quot;</span></span>
+
#'''name''' : To reuse your variable, you'll need to be able to reference it either within the template itself, or in an external file that will be processed ( variables replaced ).
-
<span class="sc3"> <span class="re0">default</span>=<span class="st0">&quot;false&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;boolean&quot;</span> <span class="re2">/&gt;</span></span>
+
#'''label''' : What will be displayed to the users within the template GUI.
-
  <span class="sc3"><span class="re1">&lt;hyperlink</span> <span class="re0">label</span>=<span class="st0">&quot;More About Unit Testing&quot;</span> <span class="re0">target</span>=<span class="st0">&quot;http://www.flexunit.com...&quot;</span> </span>
+
#'''default''' : The starting value for the variable.
-
<span class="sc3">         <span class="re0">style</span>=<span class="st0">&quot;hyperlink&quot;</span> <span class="re2">/&gt;</span></span>
+
#'''type''' : Use this to set the UI component (e.g. text input, combo box, radio button).
-
<span class="sc3"><span class="re1">&lt;/group<span class="re2">&gt;</span></span></span>
+
#'''description''' : An optional description for documentation purposes.
-
   <span class="sc3"><span class="re1">&lt;/primaryGroup<span class="re2">&gt;</span></span></span>
+
#'''enableIf''' : A boolean that can disable and enable the variable.
-
<span class="sc3"><span class="re1">&lt;/variables<span class="re2">&gt;</span></span></span></pre></div></div>
+
 
-
<p><br />
+
When using the ''type'' attribute here are some examples of UI components you can create:
-
<b>Arguments</b>:  
+
 
-
</p>
+
*'''enum('value 1','value 2','value 3',...)''': This will create a combo box or radio button set of predefined values.  The default for ''enum'' will be a combo box. To create radio buttons, add a ''style=radio'' attribute.
-
<ol><li><b>label</b>&nbsp;: The text that will appear for the button / hyperlink.
+
*'''color''': This will create a button that will display a color hex value and allow you to open the color picker.
-
</li><li><b>description</b>&nbsp;: An optional description for documentation purposes.
+
*'''int('minimum value','maximum value','increment value')''': This will create a text input for number values based on the define range.
-
</li><li><b>enableIf</b>&nbsp;: A boolean that can disable and enable the link.
+
*'''float''': Creates a text input for float values.
-
</li><li><b>style</b>&nbsp;: Use this to set the UI as a button or an HTML style link. Possible values are <i>popupButton</i> and <i>hyperlink</i>.
+
*'''string''': A text input.
-
</li></ol>
+
*'''string('value 1','value 2',...)''': A text input with a combo box that allows for preset (but editable) values.
-
<p><br />
+
*'''boolean''': This will create a checkbox that will toggle the variable from ''true'' to ''false''.
-
</p>
+
 
-
<hr />
+
 
-
<h1>Expressions</h1>
+
 
-
<h2>Overview</h2>
+
----
-
<p>Expressions allow you to create more variables (not associated with any UI), if/else statements, hashmaps(maps) and concatenation expressions.
+
 
-
</p><p>There are different ways of using expressions.   
+
==hyperlink==
-
</p>
+
Within group elements, you can add a hyperlink which will open your browser and navigate to a particular URL.
-
<h3>Simple Assignments</h3>
+
 
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;expressions<span class="re2">&gt;</span></span></span>
+
<syntaxhighlight lang="xml">
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;sourceFolder&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;src&quot;</span> <span class="re2">/&gt;</span></span>
+
<variables>
-
<span class="sc3"><span class="re1">&lt;/expressions<span class="re2">&gt;</span></span></span></pre></div></div>
+
   <primaryGroup label="Template Options">
-
<h3>Arithmetic Operations</h3>
+
     <group>
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;expressions<span class="re2">&gt;</span></span></span>
+
       <variable name="addUnitTesting" label="Add Unit Testing"
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;number&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;8*2&quot;</span><span class="re2">/&gt;</span></span>
+
default="false" type="boolean" />
-
<span class="sc3"><span class="re1">&lt;/expressions<span class="re2">&gt;</span></span></span></pre></div></div>
+
  <hyperlink label="More About Unit Testing" target="http://www.flexunit.com..."
-
<p><br />
+
        style="hyperlink" />
-
</p>
+
</group>
-
<h3>Boolean Operations</h3>
+
   </primaryGroup>
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;expressions<span class="re2">&gt;</span></span></span>
+
</variables>
-
   <span class="sc-1">&lt;!--using operator symbols such as '||' and '&amp;amp;&amp;amp;' --&gt;</span>
+
</syntaxhighlight>
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;allUnitTestingSamples&quot;</span> </span>
+
 
-
<span class="sc3">    <span class="re0">value</span>=<span class="st0">&quot;${addExample} &amp;amp;&amp;amp; ${addUnitTesting} &amp;amp;&amp;amp; ${addCIExample}&quot;</span><span class="re2">/&gt;</span></span>
+
 
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;anyExampleChosen&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;${addExample} || ${addCIExample}&quot;</span><span class="re2">/&gt;</span></span>
+
'''Arguments''':  
-
&nbsp;
+
#'''label''' : The text that will appear for the button / hyperlink.
-
   <span class="sc-1">&lt;!--using operator expressions such as 'or()' and 'and()' --&gt;</span>
+
#'''description''' : An optional description for documentation purposes.
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;allUnitTestingSamples2&quot;</span> </span>
+
#'''enableIf''' : A boolean that can disable and enable the link.
-
<span class="sc3">    <span class="re0">value</span>=<span class="st0">&quot;and(${addExample}, ${addUnitTesting},  ${addCIExample}&quot;</span><span class="re2">/&gt;</span></span>
+
#'''style''' : Use this to set the UI as a button or an HTML style link. Possible values are ''popupButton'' and ''hyperlink''.
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;anyExampleChosen2&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;or(${addExample} ,${addCIExample})&quot;</span><span class="re2">/&gt;</span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;/expressions<span class="re2">&gt;</span></span></span></pre></div></div>
+
 
-
<p><br />
+
 
-
</p>
+
----
-
<ul><li>note: Because of how Ant works, you need to use the '&amp;amp;&amp;amp;' syntax when you want to use '&amp;&amp;'.
+
 
-
</li><li>note: Expressions 'and(value 1, value 2,...)' and 'or(value 1, value 2,...)' can accept any number of arguments.
+
=Expressions=
-
</li></ul>
+
 
-
<h3>String Operations</h3>
+
==Overview==
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;expressions<span class="re2">&gt;</span></span></span>
+
Expressions allow you to create more variables (not associated with any UI), if/else statements, hashmaps(maps) and concatenation expressions.
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;var&quot;</span> <span class="re0">value</span>=<span class="st0">&quot; wonderful &quot;</span><span class="re2">/&gt;</span></span>
+
 
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;myExp&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;concat('hello ',${var},' world')&quot;</span> <span class="re2">/&gt;</span></span>
+
There are different ways of using expressions.   
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;myExp2&quot;</span> <span class="re2">&gt;</span></span>hello wonderful world<span class="sc3"><span class="re1">&lt;/expression<span class="re2">&gt;</span></span></span>
+
 
-
<span class="sc-1">&lt;!--both output 'hello wonderful world' --&gt;</span>
+
===Simple Assignments===
-
<span class="sc3"><span class="re1">&lt;/expressions<span class="re2">&gt;</span></span></span></pre></div></div>
+
 
-
<p><br />
+
 
-
</p>
+
<syntaxhighlight lang="xml">
-
<ul><li>note: 'concat(value 1, value 2, value 3,...)' can accept any number of arguments.
+
<expressions>
-
</li></ul>
+
   <expression name="sourceFolder" value="src" />
-
<p><br />
+
</expressions>
-
</p>
+
</syntaxhighlight>
-
<hr />
+
 
-
<h2>expressions</h2>
+
===Arithmetic Operations===
-
<p>The <i>expressions</i> element is used as a placeholder for your expressions. It can only appear once in your description.xml.
+
 
-
</p>
+
<syntaxhighlight lang="xml">
-
<hr />
+
<expressions>
-
<h2>expression</h2>
+
   <expression name="number" value="8*2"/>
-
<p>Inside of your <i>expressions</i> tag you can place individual expressions and maps.  An expression can be either a simple variable creation or an evaluation. Examples include:  
+
</expressions>
-
</p>
+
</syntaxhighlight>
-
<ul><li>if('boolean','use this value if true','use this value if false')
+
 
-
</li><li>concat(value 1, value 2, value 3,...)
+
 
-
</li><li>and(value 1, value 2, ...)
+
===Boolean Operations===
-
</li><li>or(value 1, value 2, ...)
+
 
-
</li><li>true
+
<syntaxhighlight lang="xml">
-
</li><li>false
+
<expressions>
-
</li></ul>
+
   <!--using operator symbols such as '||' and '&amp;&amp;' -->
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;expressions<span class="re2">&gt;</span></span></span>
+
   <expression name="allUnitTestingSamples"  
-
   <span class="sc-1">&lt;!-- simple variable declaration--&gt;</span>
+
    value="${addExample} &amp;&amp; ${addUnitTesting} &amp;&amp; ${addCIExample}"/>
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;sourceFolder&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;src&quot;</span> <span class="re2">/&gt;</span></span>
+
   <expression name="anyExampleChosen" value="${addExample} || ${addCIExample}"/>
-
   <span class="sc-1">&lt;!-- using the concat() expression--&gt;</span>
+
 
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;metaDataExp&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;concat('[SWF(backgroundColor=&amp;quot;',0xFFFFFF,</span>
+
   <!--using operator expressions such as 'or()' and 'and()' -->
-
<span class="sc3">'&amp;quot;,frameRate=&amp;quot;',bannerFPS(${metaTheme}),'&amp;quot;, width=&amp;quot;',</span>
+
   <expression name="allUnitTestingSamples2"  
-
<span class="sc3">bannerWidth(${metaTheme}),'&amp;quot;,height=&amp;quot;',bannerHeight(${metaTheme}),</span>
+
    value="and(${addExample}, ${addUnitTesting},  ${addCIExample}"/>
-
<span class="sc3">'&amp;quot;)]')&quot;</span> <span class="re2">/&gt;</span></span>
+
   <expression name="anyExampleChosen2" value="or(${addExample} ,${addCIExample})"/>
-
   <span class="sc-1">&lt;!-- using an if() expression--&gt;</span>
+
</expressions>
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;htmlDesc&quot;</span></span>
+
</syntaxhighlight>
-
<span class="sc3">    <span class="re0">value</span>=<span class="st0">&quot;if(${htmlTemplate},</span>
+
 
-
<span class="sc3">  'This HTML wrapper will create a simple HTML page with </span>
+
 
-
<span class="sc3"> your SWF embedded in it.',' ')&quot;</span> <span class="re2">/&gt;</span></span>
+
*note: Because of how Ant works, you need to use the '&amp;amp;&amp;amp;' syntax when you want to use '&&'.
-
<span class="sc3"><span class="re1">&lt;/expressions<span class="re2">&gt;</span></span></span></pre></div></div>
+
*note: Expressions 'and(value 1, value 2,...)' and 'or(value 1, value 2,...)' can accept any number of arguments.
-
<p><br />
+
 
-
</p>
+
===String Operations===
-
<hr />
+
 
-
<h2>map</h2>
+
<syntaxhighlight lang="xml">
-
<p>A map (hashmap, hash table, dictionary) is a way to create a collection of key value pairs. This is helpful when creating themes or predefined sets. Whenever a particular theme or set is selected, various variables and values can be changed throughout your template.
+
<expressions>
-
</p>
+
   <expression name="var" value=" wonderful "/>
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc-1">&lt;!-- Create a variable (a collection of 'themes') that users can select and change--&gt;</span>
+
   <expression name="myExp" value="concat('hello ',${var},' world')" />
-
<span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;metaTheme&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Application Type&quot;</span></span>
+
   <expression name="myExp2" >hello wonderful world</expression>
-
<span class="sc3"><span class="re0">default</span>=<span class="st0">&quot;Leaderboard&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;enum('Leaderboard','Full Banner','Half Banner','Full Site')&quot;</span><span class="re2">/&gt;</span></span>
+
<!--both output 'hello wonderful world' -->
-
&nbsp;
+
</expressions>
-
&nbsp;
+
</syntaxhighlight>
-
<span class="sc3"><span class="re1">&lt;expressions<span class="re2">&gt;</span></span></span>
+
 
-
   <span class="sc-1">&lt;!-- Create some maps associated with the value of 'metaTheme' --&gt;</span>
+
 
-
   <span class="sc3"><span class="re1">&lt;map</span> <span class="re0">name</span>=<span class="st0">&quot;bannerWidth&quot;</span> <span class="re2">&gt;</span></span>
+
*note: 'concat(value 1, value 2, value 3,...)' can accept any number of arguments.
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Leaderboard&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'728'&quot;</span><span class="re2">/&gt;</span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Full Banner&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'468'&quot;</span><span class="re2">/&gt;</span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Half Banner&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'234'&quot;</span><span class="re2">/&gt;</span></span>
+
----
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Full Site&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'800'&quot;</span><span class="re2">/&gt;</span></span>
+
 
-
   <span class="sc3"><span class="re1">&lt;/map<span class="re2">&gt;</span></span></span>
+
==expressions==
-
   <span class="sc3"><span class="re1">&lt;map</span> <span class="re0">name</span>=<span class="st0">&quot;bannerHeight&quot;</span> <span class="re2">&gt;</span></span>
+
The ''expressions'' element is used as a placeholder for your expressions. It can only appear once in your description.xml.
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Leaderboard&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'90'&quot;</span><span class="re2">/&gt;</span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Full Banner&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'60'&quot;</span><span class="re2">/&gt;</span></span>
+
----
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Half Banner&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'60'&quot;</span><span class="re2">/&gt;</span></span>
+
==expression==
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Full Site&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'600'&quot;</span><span class="re2">/&gt;</span></span>
+
Inside of your ''expressions'' tag you can place individual expressions and maps.  An expression can be either a simple variable creation or an evaluation. Examples include:  
-
   <span class="sc3"><span class="re1">&lt;/map<span class="re2">&gt;</span></span></span>
+
 
-
   <span class="sc3"><span class="re1">&lt;map</span> <span class="re0">name</span>=<span class="st0">&quot;bannerFPS&quot;</span> <span class="re2">&gt;</span></span>
+
*if('boolean','use this value if true','use this value if false')
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Leaderboard&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'22'&quot;</span><span class="re2">/&gt;</span></span>
+
*concat(value 1, value 2, value 3,...)
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Full Banner&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'22'&quot;</span><span class="re2">/&gt;</span></span>
+
*and(value 1, value 2, ...)
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Half Banner&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'22'&quot;</span><span class="re2">/&gt;</span></span>
+
*or(value 1, value 2, ...)
-
<span class="sc3"><span class="re1">&lt;entry</span> <span class="re0">key</span>=<span class="st0">&quot;Full Site&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;'60'&quot;</span><span class="re2">/&gt;</span></span>
+
*true
-
   <span class="sc3"><span class="re1">&lt;/map<span class="re2">&gt;</span></span></span>
+
*false
-
<span class="sc-1">&lt;!-- Use the maps and pass to them, as a key, the theme you chose. </span>
+
 
-
<span class="sc-1"> E.g if 'metaTheme' is equal to 'Leaderboard', </span>
+
<syntaxhighlight lang="xml">
-
<span class="sc-1">then 'bannerFPS(${metaTheme})' is equal to 728--&gt;</span>
+
<expressions>
-
   <span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;metaDataExp&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;concat('[SWF(backgroundColor=&amp;quot;',0xFFFFFF,</span>
+
   <!-- simple variable declaration-->
-
<span class="sc3">'&amp;quot;,frameRate=&amp;quot;',bannerFPS(${metaTheme}),'&amp;quot;, width=&amp;quot;',</span>
+
   <expression name="sourceFolder" value="src" />
-
<span class="sc3">bannerWidth(${metaTheme}),'&amp;quot;,height=&amp;quot;',bannerHeight(${metaTheme}),</span>
+
   <!-- using the concat() expression-->
-
<span class="sc3">'&amp;quot;)]')&quot;</span> <span class="re2">/&gt;</span></span>
+
   <expression name="metaDataExp" value="concat('[SWF(backgroundColor=&quot;',0xFFFFFF,
-
&nbsp;
+
'&quot;,frameRate=&quot;',bannerFPS(${metaTheme}),'&quot;, width=&quot;',
-
<span class="sc3"><span class="re1">&lt;/expressions<span class="re2">&gt;</span></span></span></pre></div></div>
+
bannerWidth(${metaTheme}),'&quot;,height=&quot;',bannerHeight(${metaTheme}),
-
<p><br />
+
'&quot;)]')" />
-
</p><p><br />
+
   <!-- using an if() expression-->
-
</p>
+
   <expression name="htmlDesc"
-
<hr />
+
    value="if(${htmlTemplate},
-
<p><br />
+
  'This HTML wrapper will create a simple HTML page with  
-
</p>
+
your SWF embedded in it.',' ')" />
-
<h2>Replace</h2>
+
</expressions>
-
<p>With 4.5, FDT extended the expressions syntax with two new expressions: 'replace' and 'replaceRegex'. Both of these allow you to replace the values of strings or variables.
+
</syntaxhighlight>
-
</p>
+
 
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc-1">&lt;!-- Create a variable (a collection of 'themes') that users can select and change--&gt;</span>
+
 
-
<span class="sc3"><span class="re1">&lt;variable</span> <span class="re0">name</span>=<span class="st0">&quot;metaTheme&quot;</span> <span class="re0">label</span>=<span class="st0">&quot;Application Type&quot;</span></span>
+
 
-
<span class="sc3"><span class="re0">default</span>=<span class="st0">&quot;Leaderboard&quot;</span> <span class="re0">type</span>=<span class="st0">&quot;enum('Leaderboard','Full Banner','Half Banner','Full Site')&quot;</span><span class="re2">/&gt;</span></span>
+
----
-
&nbsp;
+
 
-
<span class="sc3"><span class="re1">&lt;expressions<span class="re2">&gt;</span></span></span>
+
==map==
-
&nbsp;
+
A map (hashmap, hash table, dictionary) is a way to create a collection of key value pairs. This is helpful when creating themes or predefined sets. Whenever a particular theme or set is selected, various variables and values can be changed throughout your template.
-
<span class="sc-1">&lt;!-- This will create a new expression (variable) named 'postFileName'. </span>
+
 
-
<span class="sc-1">This expression will execute a regex computation on the variable ${projectName} </span>
+
<syntaxhighlight lang="xml">
-
<span class="sc-1">and replace it.  In this case it's replacing it with blank: ''. --&gt;</span>
+
<!-- Create a variable (a collection of 'themes') that users can select and change-->
-
<span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;postFileName&quot;</span></span>
+
<variable name="metaTheme" label="Application Type"
-
<span class="sc3"> <span class="re0">value</span>=<span class="st0">&quot;replaceRegex(${projectName}, '([^\w]+)', '')&quot;</span> <span class="re2">/&gt;</span></span>
+
default="Leaderboard" type="enum('Leaderboard','Full Banner','Half Banner','Full Site')"/>
-
&nbsp;
+
 
-
<span class="sc-1">&lt;!-- This expression will scan the variable '${projectName}' and if it finds the value</span>
+
 
-
<span class="sc-1"> 'Joe', it will replace it with 'Bob' --&gt;</span>
+
<expressions>
-
<span class="sc3"><span class="re1">&lt;expression</span> <span class="re0">name</span>=<span class="st0">&quot;postFileName&quot;</span></span>
+
   <!-- Create some maps associated with the value of 'metaTheme' -->
-
<span class="sc3"> <span class="re0">value</span>=<span class="st0">&quot;replace(${projectName}, 'Joe', 'Bob')&quot;</span> <span class="re2">/&gt;</span></span>
+
   <map name="bannerWidth" >
-
<span class="sc3"><span class="re1">&lt;/expressions<span class="re2">&gt;</span></span></span></pre></div></div>
+
<entry key="Leaderboard" value="'728'"/>
-
<p><b>Arguments</b>:
+
<entry key="Full Banner" value="'468'"/>
-
</p>
+
<entry key="Half Banner" value="'234'"/>
-
<ol><li><b>name</b>&nbsp;: The reference (variable name) of the expression. Use this to reference the expression elsewhere in the template or your files.
+
<entry key="Full Site" value="'800'"/>
-
</li><li><b>value</b>&nbsp;: Three values: replaceRegex([the variable or string you'd like to evaluate],[what to look for],[what to replace if found])
+
   </map>
-
</li></ol>
+
   <map name="bannerHeight" >
-
<h1>Extensions</h1>
+
<entry key="Leaderboard" value="'90'"/>
-
<p>The extensions tag is used internally by the team to add functionality to templates into the future. When this is developed, more information will added here.
+
<entry key="Full Banner" value="'60'"/>
-
</p><p><br />
+
<entry key="Half Banner" value="'60'"/>
-
</p>
+
<entry key="Full Site" value="'600'"/>
-
<hr />
+
   </map>
-
<h1>Folders</h1>
+
   <map name="bannerFPS"  >
-
<h2>folders</h2>
+
<entry key="Leaderboard" value="'22'"/>
-
<p>This tag, and its descendants, is used to define properties of special folders in your project. This is where you define which folders are source folder(s), your output folder, and auto library folder(s). If the folder referenced here doesn't exist when the project is created, FDT will create it.
+
<entry key="Full Banner" value="'22'"/>
-
</p>
+
<entry key="Half Banner" value="'22'"/>
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;folders<span class="re2">&gt;</span></span></span>
+
<entry key="Full Site" value="'60'"/>
-
<span class="sc-1">&lt;!-- set, or create, a source folder named 'src' --&gt;</span>
+
   </map>
-
<span class="sc3"><span class="re1">&lt;sourceFolder<span class="re2">&gt;</span></span></span>src<span class="sc3"><span class="re1">&lt;/sourceFolder<span class="re2">&gt;</span></span></span>
+
<!-- Use the maps and pass to them, as a key, the theme you chose.  
-
<span class="sc-1">&lt;!-- set, or create, a source folder named 'src2' --&gt;</span>
+
E.g if 'metaTheme' is equal to 'Leaderboard',  
-
<span class="sc3"><span class="re1">&lt;sourceFolder<span class="re2">&gt;</span></span></span>src2<span class="sc3"><span class="re1">&lt;/sourceFolder<span class="re2">&gt;</span></span></span>
+
then 'bannerFPS(${metaTheme})' is equal to 728-->
-
<span class="sc-1">&lt;!-- set, or create, an output folder named 'bin-debug' --&gt;</span>
+
   <expression name="metaDataExp" value="concat('[SWF(backgroundColor=&quot;',0xFFFFFF,
-
<span class="sc3"><span class="re1">&lt;outputFolder<span class="re2">&gt;</span></span></span>bin-debug<span class="sc3"><span class="re1">&lt;/outputFolder<span class="re2">&gt;</span></span></span>
+
'&quot;,frameRate=&quot;',bannerFPS(${metaTheme}),'&quot;, width=&quot;',
-
&nbsp;
+
bannerWidth(${metaTheme}),'&quot;,height=&quot;',bannerHeight(${metaTheme}),
-
<span class="sc-1">&lt;!-- set, or create, various auto library folders --&gt;</span>
+
'&quot;)]')" />
-
<span class="sc3"><span class="re1">&lt;autoLibFolder<span class="re2">&gt;</span></span></span>libs<span class="sc3"><span class="re1">&lt;/autoLibFolder<span class="re2">&gt;</span></span></span>
+
-
<span class="sc3"><span class="re1">&lt;autoLibFolder<span class="re2">&gt;</span></span></span>libs2<span class="sc3"><span class="re1">&lt;/autoLibFolder<span class="re2">&gt;</span></span></span>
+
</expressions>
-
<span class="sc3"><span class="re1">&lt;/folders<span class="re2">&gt;</span></span></span></pre></div></div>
+
</syntaxhighlight>
-
<p><br />
+
 
-
</p>
+
 
-
<hr />
+
 
-
<h2>sourceFolder</h2>
+
----
-
<p>When your project is created, FDT will create a source folder for you.
+
 
-
</p>
+
=Extensions=
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;folders<span class="re2">&gt;</span></span></span>
+
 
-
<span class="sc-1">&lt;!-- set, or create, a source folder named 'src' --&gt;</span>
+
The extensions tag is used internally by the team to add functionality to templates into the future. When this is developed, more information will added here.
-
<span class="sc3"><span class="re1">&lt;sourceFolder<span class="re2">&gt;</span></span></span>src<span class="sc3"><span class="re1">&lt;/sourceFolder<span class="re2">&gt;</span></span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;/folders<span class="re2">&gt;</span></span></span></pre></div></div>
+
 
-
<p><br />
+
 
-
<b>Arguments</b>:  
+
----
-
</p>
+
 
-
<ol><li><b>if</b>&nbsp;: A boolean value that determines if the folder is created.
+
=Folders=
-
</li></ol>
+
==folders==
-
<p><br />
+
This tag, and its descendants, is used to define properties of special folders in your project. This is where you define which folders are source folder(s), your output folder, and auto library folder(s). If the folder referenced here doesn't exist when the project is created, FDT will create it.
-
</p>
+
 
-
<hr />
+
<syntaxhighlight lang="xml">
-
<h2>outputFolder</h2>
+
<folders>
-
<p>When your project is created, FDT will preset your output folder for you.
+
<!-- set, or create, a source folder named 'src' -->
-
</p>
+
<sourceFolder>src</sourceFolder>
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;folders<span class="re2">&gt;</span></span></span>
+
<!-- set, or create, a source folder named 'src2' -->
-
<span class="sc-1">&lt;!-- set, or create, an output folder named 'bin-debug' --&gt;</span>
+
<sourceFolder>src2</sourceFolder>
-
<span class="sc3"><span class="re1">&lt;outputFolder<span class="re2">&gt;</span></span></span>bin-debug<span class="sc3"><span class="re1">&lt;/outputFolder<span class="re2">&gt;</span></span></span>
+
<!-- set, or create, an output folder named 'bin-debug' -->
-
<span class="sc3"><span class="re1">&lt;/folders<span class="re2">&gt;</span></span></span></pre></div></div>
+
<outputFolder>bin-debug</outputFolder>
-
<p><br />
+
 
-
<b>Arguments</b>:  
+
<!-- set, or create, various auto library folders -->
-
</p>
+
<autoLibFolder>libs</autoLibFolder>
-
<ol><li><b>if</b>&nbsp;: A boolean value that determines if the folder is created.
+
<autoLibFolder>libs2</autoLibFolder>
-
</li></ol>
+
</folders>
-
<p><br />
+
</syntaxhighlight>
-
</p>
+
 
-
<hr />
+
 
-
<h2>autoLibFolder</h2>
+
 
-
<p>When your project is created, FDT will create an auto library folder for you.
+
----
-
</p>
+
 
-
<div dir="ltr" class="mw-geshi" style="text-align: left;"><div class="xml source-xml"><pre class="de1"><span class="sc3"><span class="re1">&lt;folders<span class="re2">&gt;</span></span></span>
+
==sourceFolder==
-
<span class="sc-1">&lt;!-- set, or create, various auto library folders --&gt;</span>
+
When your project is created, FDT will create a source folder for you.
-
<span class="sc3"><span class="re1">&lt;autoLibFolder<span class="re2">&gt;</span></span></span>libs<span class="sc3"><span class="re1">&lt;/autoLibFolder<span class="re2">&gt;</span></span></span>
+
 
-
<span class="sc3"><span class="re1">&lt;/folders<span class="re2">&gt;</span></span></span></pre></div></div>
+
<syntaxhighlight lang="xml">
-
<p><b>Arguments</b>:  
+
<folders>
-
</p>
+
<!-- set, or create, a source folder named 'src' -->
-
<ol><li><b>if</b>&nbsp;: A boolean value that determines if the folder is created.
+
<sourceFolder>src</sourceFolder>
-
</li></ol>
+
</folders>
-
<p><br />
+
</syntaxhighlight>
-
</p>
+
 
-
<hr />
+
 
-
<h1>Libraries</h1>
+
'''Arguments''':  
-
<h2>libraries</h2>
+
#'''if''' : A boolean value that determines if the folder is created.
-
<p>Use this tag to define a particular .SWC or .ANE to be added to your class path upon template generation. .SWC and .ANE locations are relative to your project root.
+
 
-
</p>
+
 
-
<ul><li><i>note</i>: When using SWCs, this tag is best implemented when using linked resources; otherwise, we suggest placing your .SWCs inside of an Auto Library Folder.
+
 
-
</li></ul>
+
----
-
<ul><li><i>note</i>: The <div style="border: solid red 1px; padding: .5em;"><p>Invalid language.</p><p>You need to specify a language like this: <samp>&lt;source lang=&quot;html4strict&quot;&gt;...&lt;/source&gt;</samp></p><p>Supported languages for syntax highlighting:</p><p style="padding: 0em 1em;"><samp>4cs</samp>, <samp>abap</samp>, <samp>actionscript</samp>, <samp>actionscript3</samp>, <samp>ada</samp>, <samp>apache</samp>, <samp>applescript</samp>, <samp>apt_sources</samp>, <samp>asm</samp>, <samp>asp</samp>, <samp>autoconf</samp>, <samp>autohotkey</samp>, <samp>autoit</samp>, <samp>avisynth</samp>, <samp>awk</samp>, <samp>bash</samp>, <samp>basic4gl</samp>, <samp>bf</samp>, <samp>bibtex</samp>, <samp>blitzbasic</samp>, <samp>bnf</samp>, <samp>boo</samp>, <samp>c</samp>, <samp>c_mac</samp>, <samp>caddcl</samp>, <samp>cadlisp</samp>, <samp>cfdg</samp>, <samp>cfm</samp>, <samp>chaiscript</samp>, <samp>cil</samp>, <samp>clojure</samp>, <samp>cmake</samp>, <samp>cobol</samp>, <samp>cpp</samp>, <samp>cpp-qt</samp>, <samp>csharp</samp>, <samp>css</samp>, <samp>cuesheet</samp>, <samp>d</samp>, <samp>dcs</samp>, <samp>delphi</samp>, <samp>diff</samp>, <samp>div</samp>, <samp>dos</samp>, <samp>dot</samp>, <samp>ecmascript</samp>, <samp>eiffel</samp>, <samp>email</samp>, <samp>erlang</samp>, <samp>fo</samp>, <samp>fortran</samp>, <samp>freebasic</samp>, <samp>fsharp</samp>, <samp>gambas</samp>, <samp>gdb</samp>, <samp>genero</samp>, <samp>genie</samp>, <samp>gettext</samp>, <samp>glsl</samp>, <samp>gml</samp>, <samp>gnuplot</samp>, <samp>groovy</samp>, <samp>gwbasic</samp>, <samp>haskell</samp>, <samp>hicest</samp>, <samp>hq9plus</samp>, <samp>html4strict</samp>, <samp>icon</samp>, <samp>idl</samp>, <samp>ini</samp>, <samp>inno</samp>, <samp>intercal</samp>, <samp>io</samp>, <samp>j</samp>, <samp>java</samp>, <samp>java5</samp>, <samp>javascript</samp>, <samp>jquery</samp>, <samp>kixtart</samp>, <samp>klonec</samp>, <samp>klonecpp</samp>, <samp>latex</samp>, <samp>lisp</samp>, <samp>locobasic</samp>, <samp>logtalk</samp>, <samp>lolcode</samp>, <samp>lotusformulas</samp>, <samp>lotusscript</samp>, <samp>lscript</samp>, <samp>lsl2</samp>, <samp>lua</samp>, <samp>m68k</samp>, <samp>magiksf</samp>, <samp>make</samp>, <samp>mapbasic</samp>, <samp>matlab</samp>, <samp>mirc</samp>, <samp>mmix</samp>, <samp>modula2</samp>, <samp>modula3</samp>, <samp>mpasm</samp>, <samp>mxml</samp>, <samp>mysql</samp>, <samp>newlisp</samp>, <samp>nsis</samp>, <samp>oberon2</samp>, <samp>objc</samp>, <samp>ocaml</samp>, <samp>ocaml-brief</samp>, <samp>oobas</samp>, <samp>oracle11</samp>, <samp>oracle8</samp>, <samp>oxygene</samp>, <samp>oz</samp>, <samp>pascal</samp>, <samp>pcre</samp>, <samp>per</samp>, <samp>perl</samp>, <samp>perl6</samp>, <samp>pf</samp>, <samp>php</samp>, <samp>php-brief</samp>, <samp>pic16</samp>, <samp>pike</samp>, <samp>pixelbender</samp>, <samp>plsql</samp>, <samp>postgresql</samp>, <samp>povray</samp>, <samp>powerbuilder</samp>, <samp>powershell</samp>, <samp>progress</samp>, <samp>prolog</samp>, <samp>properties</samp>, <samp>providex</samp>, <samp>purebasic</samp>, <samp>python</samp>, <samp>q</samp>, <samp>qbasic</samp>, <samp>rails</samp>, <samp>rebol</samp>, <samp>reg</samp>, <samp>robots</samp>, <samp>rpmspec</samp>, <samp>rsplus</samp>, <samp>ruby</samp>, <samp>sas</samp>, <samp>scala</samp>, <samp>scheme</samp>, <samp>scilab</samp>, <samp>sdlbasic</samp>, <samp>smalltalk</samp>, <samp>smarty</samp>, <samp>sql</samp>, <samp>systemverilog</samp>, <samp>tcl</samp>, <samp>teraterm</samp>, <samp>text</samp>, <samp>thinbasic</samp>, <samp>tsql</samp>, <samp>typoscript</samp>, <samp>unicon</samp>, <samp>vala</samp>, <samp>vb</samp>, <samp>vbnet</samp>, <samp>verilog</samp>, <samp>vhdl</samp>, <samp>vim</samp>, <samp>visualfoxpro</samp>, <samp>visualprolog</samp>, <samp>whitespace</samp>, <samp>whois</samp>, <samp>winbatch</samp>, <samp>xbasic</samp>, <samp>xml</samp>, <samp>xorg_conf</samp>, <samp>xpp</samp>, <samp>z80</samp></p></div>
+
 
-
</li></ul>
+
==outputFolder==
 +
When your project is created, FDT will preset your output folder for you.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<folders>
 +
<!-- set, or create, an output folder named 'bin-debug' -->
 +
<outputFolder>bin-debug</outputFolder>
 +
</folders>
 +
</syntaxhighlight>
 +
 
 +
 
 +
'''Arguments''':  
 +
#'''if''' : A boolean value that determines if the folder is created.
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==autoLibFolder==
 +
When your project is created, FDT will create an auto library folder for you.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<folders>
 +
<!-- set, or create, various auto library folders -->
 +
<autoLibFolder>libs</autoLibFolder>
 +
</folders>
 +
</syntaxhighlight>
 +
 
 +
'''Arguments''':  
 +
#'''if''' : A boolean value that determines if the folder is created.
 +
 
 +
 
 +
 
 +
----
 +
 
 +
=Libraries=
 +
==libraries==
 +
*''note'': This tag is best implemented when using linked resources; otherwise, we suggest placing your .SWCs inside of an Auto Library Folder.
 +
 
 +
Use this tag to define a particular .SWC to be added to your class path upon template generation. .SWC locations are relative to your project root.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<libraries>
 +
  <swc>
 +
    <path>gs/greensock.swc</path>
 +
  </swc>
 +
</libraries>
 +
</syntaxhighlight>
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==swc==
 +
Adds a .SWC, located within your project, to your source path.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<libraries>
 +
  <swc if="true">
 +
<path>gs/greensock.swc</path>
 +
  </swc>
 +
</libraries>
 +
</syntaxhighlight>
 +
 
 +
 
 +
'''Arguments''':  
 +
#'''if''' : A boolean value that determines if the .SWC is added to your project's source path.
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==path==
 +
The path for the file alias to exists in your project.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<libraries>
 +
  <swc if="true">
 +
<path>gs/greensock.swc</path>
 +
  </swc>
 +
</libraries>
 +
</syntaxhighlight>
 +
 
 +
 
 +
 
 +
----
 +
 
 +
=Linked Resources=
 +
==linkedResources==
 +
If you have source code, either as .AS files or as .SWCs, located outside of your project, you can use the ''linkedResources'' tag to have FDT add it as a linked reference to your project. To make sure it is added to your source path, add a corresponding ''libraries'' or ''sourceFolder'' element.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<libraries>
 +
  <swc if="${addGreensockLinkedReference}">
 +
<path>libs/greensock.swc</path>
 +
  </swc>
 +
</libraries>
 +
 
 +
<linkedResources>
 +
  <linkedFile if="${addGreensockLinkedReference}">
 +
<path>libs/greensock.swc</path>
 +
<location>/Users/OSX/_dev/code/greensock-as3/greensock.swc</location>
 +
  </linkedFile>
 +
  <linkedFolder if="${addGreensockSourceCode}">
 +
<path>gs/src</path>
 +
<location>/Users/OSX/_dev/code/greensock-as3/src</location>
 +
  </linkedFolder>
 +
</linkedResources>
 +
</syntaxhighlight>
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==linkedFile==
 +
Within a ''linkedResources'' element, use this tag to add a .SWC, that is outside of your project's directory, to your project's source path.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<linkedResources>
 +
  <linkedFile if="true">
 +
<path>libs/greensock.swc</path>
 +
<location>/Users/OSX/_dev/code/greensock-as3/greensock.swc</location>
 +
  </linkedFile>
 +
</linkedResources>
 +
</syntaxhighlight>
 +
 
 +
 
 +
'''Arguments''':
 +
#'''if''' : A boolean value that determines if the .SWC is added to your project's source path.
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==linkedFolder==
 +
Within a ''linkedResources'' element, use this tag to add a source folder, that is outside of your project's directory, to your project's source path.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<linkedResources>
 +
  <linkedFolder if="true">
 +
<path>gs/src</path>
 +
<location>/Users/OSX/_dev/code/greensock-as3/src</location>
 +
  </linkedFolder>
 +
</linkedResources>
 +
</syntaxhighlight>
 +
 
 +
 
 +
'''Arguments''':
 +
#'''if''' : A boolean value that determines if the folder is added to your project's source path.
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==path==
 +
The path for the file or folder alias to reference in your project.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<linkedResources>
 +
  <linkedFile if="true">
 +
<path>libs/greensock.swc</path>
 +
<location>/Users/OSX/_dev/code/greensock-as3/greensock.swc</location>
 +
  </linkedFile>
 +
  <linkedFolder if="true">
 +
<path>gs/src</path>
 +
<location>/Users/OSX/_dev/code/greensock-as3/src</location>
 +
  </linkedFolder>
 +
</linkedResources>
 +
</syntaxhighlight>
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==location==
 +
The absolute path where your referenced .SWC or folder exists on your system.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<linkedResources>
 +
  <linkedFile if="true">
 +
<path>libs/greensock.swc</path>
 +
<location>/Users/OSX/_dev/code/greensock-as3/greensock.swc</location>
 +
  </linkedFile>
 +
  <linkedFolder if="true">
 +
<path>gs/src</path>
 +
<location>/Users/OSX/_dev/code/greensock-as3/src</location>
 +
  </linkedFolder>
 +
</linkedResources>
 +
</syntaxhighlight>
 +
 
 +
 
 +
 
 +
----
 +
 
 +
==locationURI==
 +
Use this to include variables on your classpath.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<variables>
 +
  <variable name="pathVar" label="Tweenlite SWC" default="/Users/OSX" type="string"/>
 +
</variables>
 +
 
 +
<linkedResources>
 +
  <linkedFile>
 +
    <path>libs/greensock.swc</path>
 +
    <location>${pathVar}/_dev/code/greensock-as3/greensock.swc</location>
 +
  </linkedFile>
 +
</linkedResources>
 +
</syntaxhighlight>
 +
 
 +
=Content Creation=
 +
==contentCreation==
 +
Us this tag to specify which files and folders to process and or include. If your template does not have the ''contentCreation'' tag, FDT will copy everything inside the ''project'' folder into your new project.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<contentCreation processFileExtensions="as,mxml,xml,launch,html" >
 +
 
 +
  <!-- Always -->
 +
  <file src="as/Main.as" dest="src/Main.as" process="true" />
 +
 
 +
  <!-- If HTML Wrapper -->
 +
  <folder src="html-wrapper" dest="${outputFolder}" if="${htmlTemplate}"
 +
process="true" recursive="true" />
 +
 
 +
  <!-- If Unit Testing -->
 +
  <file src="unitTesting/flexUnitTasks-4.0.0.jar" dest="script/flexUnitTasks-4.0.0.jar"
 +
  if="${addJar} &amp;&amp; ${addUnitTesting}" />
 +
  <file src="as/TestRunner.as" dest="${testFolderName}/TestRunner.as"
 +
  if="${addExample} &amp;&amp; ${addUnitTesting}" process="true" />
 +
  <file src="as/SimpleTest.as" dest="${testFolderName}/test/SimpleTest.as"
 +
  if="${addExample} &amp;&amp; ${addUnitTesting}" />
 +
  <folder src="unitTesting/swc" dest="libs" recursive="true"
 +
  if="${addUnitTesting}" />
 +
  <folder src="${testFolderName}" recursive="true" if="${addUnitTesting}" />
 +
 +
</contentCreation>
 +
</syntaxhighlight>
 +
 
 +
 
 +
'''Arguments''':
 +
#'''processFileExtensions''' : Add which files types (extensions) you want to be processed.
 +
 
 +
----
 +
==file==
 +
Within the ''contentCreatation'' tag is another nested tag ''file''. Use this tag to evaluate whether FDT includes/excludes or processes a file.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<contentCreation processFileExtensions="as,mxml">
 +
<file src="as/Main.as" dest="src/MyMain.as" process="true" />
 +
</contentCreation>
 +
</syntaxhighlight>
 +
 
 +
 
 +
'''Arguments''':
 +
#'''src''' : The location of the file to be accessed & copied (relative to your 'project' folder).
 +
#'''dest''' : The location of the file that will be outputted into your project.
 +
#'''process''' : A boolean value whether to have FDT scan the file and replace any variables.
 +
#'''if''' : A boolean value whether to have FDT to process or copy your file at all.
 +
 
 +
----
 +
==folder==
 +
Also within the ''contentCreation'' tag, the ''folder'' tag is used to copy an entire directory's contents into your project. It works much like the ''file'' tag, but is for folders and their contents.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<contentCreation processFileExtensions="as,mxml">
 +
<folder src="unitTesting/swc" dest="libs" recursive="true"
 +
if="${addUnitTesting}" />
 +
</contentCreation>
 +
</syntaxhighlight>
 +
 
 +
 
 +
'''Arguments''':
 +
#'''src''' : The location of the folder whose contents will be copied and possibly processed (variables replaced).
 +
#'''dest''' : The destination folder where the contents will be placed.
 +
#'''process''' : A boolean value whether to have FDT scan the folder's contents and replace any variables.
 +
#'''if''' : A boolean value whether to have FDT to evaluate this folder and it's contents at all.
 +
#'''recursive''': A boolean value whether FDT should include and process sub folders.
 +
 
 +
 
 +
 
 +
----
 +
 
 +
=Global Variables=
 +
 
 +
==${projectName}==
 +
If you use this variable anywhere in your description.xml or your processed files, it will be replaced with the name of your project.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<description>
 +
This template will create a project named '${projectName}' which contains only the basic
 +
libraries to develop and compile a pure AS3 project.
 +
</description>
 +
</syntaxhighlight>
 +
 
 +
 
 +
----
 +
==${newline}==
 +
 
 +
When working with strings, you can use the ${newline} variable to create a line break.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<description>
 +
This template will create a project named '${projectName}' which contains only the basic
 +
libraries to develop and compile a pure AS3 project.${newline}${htmlDesc}
 +
</description>
 +
</syntaxhighlight>
 +
 
 +
 
 +
 
 +
[[File:Using_newline.png|center]]
 +
 
 +
=Misc=
 +
==antCall==
 +
Executes an ant script upon template creation.
 +
 
 +
<syntaxhighlight lang="xml">
 +
<antCall antFile="project/ant/updateLatestLibs.xml"/>
 +
</syntaxhighlight>
 +
 
 +
 
 +
'''Arguments''':
 +
#'''antFile''' : The location of the file to open. This file should be located inside of your 'project' folder within your template template.
 +
 
 +
*''note'': While other references to project files are relative to your project folder (e.g. using the ''file'' tag to process a particular file) this task is relative to the template folder itself. Notice in the example that that ''project'' is in the file path.
 +
 
 +
[[File:AntToRun.png|center]]
 +
 
 +
 
 +
 
 +
==Refresh Button==
 +
When using an external editor (e.g. Textmate or Notepad ) to edit your description.xml, it is helpful to have FDT rescan your description.xml for any changes. This is where the 'Refresh' button comes into play.
 +
[[File:RefreshButton.png|center]]
 +
 
 +
To add the refresh button, add a ''<debug/>'' tag to your order.xml file.
 +
[[File:DebugOrderXML.png|center]]
 +
 
 +
=Tutorial=
 +
You can find here the FDT [http://fdt.powerflasher.com/docs/Project_Templates Project Template Tutorial]

Revision as of 17:35, 27 February 2012

Template properties.png

With FDT 4.2, the FDT team greatly expanded project templates and the syntax available in the description.xml.

Contents

Template Properties

description

Use this tag to add a text description to your template. This will appear in the text area below the template selector. You can even add in variables into your description and update the user about the current selection.

Description.png
<expressions>
  <expression name="htmlDesc" value="if(${htmlTemplate},
'This HTML wrapper will create a simple HTML page with your SWF embedded in it.',' ')" />
</expressions>	
<description>
	This template will create a project named '${projectName}' 
	which contains only the basic libraries to develop and compile a 
	pure AS3 project.${newline}${htmlDesc}
</description>


  • note: Use the ${newline} keyword to create a line break in your descriptions. In the above example, if the users sets true htmlDesc then the additional text will be added, on a new line, to the description.



name

The name of your template as it appears in the new project wizard.

<name>AS3</name>



version

FDT uses this element to keep track of the version for the template in case it is to be updated.

<version>2.0</version>



projectType

Each template needs to have its projectType defined. The project type is what determines which SDK &.SWCs are automatically added to your source path, your runtime, player and compiler arguments.

The project types are located in the projectTypes folder within the FDT folder.

Project types.png


Variables

variables

The variables tag is what defines templates in FDT 4.2 and later. When a template implements this element, you'll be able to create UI elements that allow you to customize your project before completion. Your template can only have one variables element. FDT will read the first and ignore any following variables elements.

<variables>
  <primaryGroup label="Template Options"></primaryGroup>
</variables>



primaryGroup

When you create a variables element, you'll need to have a primaryGroup descendant element. Similar to variables, primaryGroup can only appear once inside of a variables element.

<variables>
  <primaryGroup label="Template Options">
    <variable name="addMetaData" label="Add Metadata" default="true"
      type="boolean" />
	<group label="Project Setup">
	  <variable name="addFla" label="Add .fla" default="true"
		type="boolean" />
	  <variable name="htmlTemplate" label="Include HTML Wrapper"
		default="false" type="boolean" />
	</group>
  </primaryGroup>
</variables>


Arguments:

  1. label : The label description that will appear at the top of the template variables UI section within the New Flash Project Wizard.
  2. description : An optional description for documentation purposes.
  • note: Other arguments, such as 'enableIf', are ignored.



group

Groups are used to organize similar variables together. They are also used to create popup buttons that will open a new window containing more UI elements. Groups can have more groups nested within them.


<variables>	
  <primaryGroup label="Options" description="My Template Variables" >
    <group label="Unit Testing">
	  <variable name="addUnitTesting" label="Add Unit Testing"
	    default="false" type="boolean" />
 
<!-- Create a popupButton that will open these UI variables in a new window -->
		<group label="More..." style="popupButton">
	  	  <variable name="testFolderName" label="Test Folder Name"
			default="test-src" type="string" />
	      <variable name="addExample" label="Add Unit Test Example"
			default="false" type="boolean" />
	      <variable name="addJar" label="Include flexUnitTasks.jar"
					default="false" type="boolean" />
	    </group>
	</group>
  </primaryGroup>
</variables>


Arguments:

  1. label : The label description that will appear at the top group.
  2. description : An optional description for documentation purposes.
  3. enableIf : A boolean that can disable and enable the UI variables within the group.
  4. style : Use this to set if the group is to be a popup window. Possible values are popupButton and hyperlink.



variable

The most powerful part of project templates are the UI variables you can create. Each variable element you create will represent itself as an interactive UI component (e.g. text input, combo box, radio button). The value of the variable will be evaluated as you change it while configuring your template.

If you reference the variable in any files (ActionScript,XML,JavaScript,HTML....) and you choose to process those files (within a contentCreation element) the variable will be replaced with whatever value you have assigned it.

To reference a variable use a dollar sign and brackets, '${}', with your variable name between the brackets.

<variables>	
  <primaryGroup label="Options">
<!-- This variable is being used to determine to add Metadata or not-->
    <variable name="addMetaData" label="Add Metadata" default="true"
	  type="boolean" />
<!-- This variable is being used to setup the base class of my ActionScript file. 
     In my ActionScript files'${classExtends}' will be replaced with whatever
 	 value it is assigned here -->	
	<variable name="classExtends" label="Base Class:" default="Sprite"
	  type="enum('Sprite','MovieClip')" />
  </primaryGroup>
</variables>


Arguments:

  1. name : To reuse your variable, you'll need to be able to reference it either within the template itself, or in an external file that will be processed ( variables replaced ).
  2. label : What will be displayed to the users within the template GUI.
  3. default : The starting value for the variable.
  4. type : Use this to set the UI component (e.g. text input, combo box, radio button).
  5. description : An optional description for documentation purposes.
  6. enableIf : A boolean that can disable and enable the variable.

When using the type attribute here are some examples of UI components you can create:

  • enum('value 1','value 2','value 3',...): This will create a combo box or radio button set of predefined values. The default for enum will be a combo box. To create radio buttons, add a style=radio attribute.
  • color: This will create a button that will display a color hex value and allow you to open the color picker.
  • int('minimum value','maximum value','increment value'): This will create a text input for number values based on the define range.
  • float: Creates a text input for float values.
  • string: A text input.
  • string('value 1','value 2',...): A text input with a combo box that allows for preset (but editable) values.
  • boolean: This will create a checkbox that will toggle the variable from true to false.



hyperlink

Within group elements, you can add a hyperlink which will open your browser and navigate to a particular URL.

<variables>
  <primaryGroup label="Template Options">
    <group>
      <variable name="addUnitTesting" label="Add Unit Testing"
		default="false" type="boolean" />
	  <hyperlink label="More About Unit Testing" target="http://www.flexunit.com..." 
	        style="hyperlink" />		
	</group>
  </primaryGroup>
</variables>


Arguments:

  1. label : The text that will appear for the button / hyperlink.
  2. description : An optional description for documentation purposes.
  3. enableIf : A boolean that can disable and enable the link.
  4. style : Use this to set the UI as a button or an HTML style link. Possible values are popupButton and hyperlink.



Expressions

Overview

Expressions allow you to create more variables (not associated with any UI), if/else statements, hashmaps(maps) and concatenation expressions.

There are different ways of using expressions.

Simple Assignments

<expressions>
  <expression name="sourceFolder" value="src" />
</expressions>

Arithmetic Operations

<expressions>
  <expression name="number" value="8*2"/>
</expressions>


Boolean Operations

<expressions>
  <!--using operator symbols such as '||' and '&amp;&amp;' -->
  <expression name="allUnitTestingSamples" 
    value="${addExample} &amp;&amp; ${addUnitTesting} &amp;&amp; ${addCIExample}"/>
  <expression name="anyExampleChosen" value="${addExample} || ${addCIExample}"/>
 
  <!--using operator expressions such as 'or()' and 'and()' -->
  <expression name="allUnitTestingSamples2" 
    value="and(${addExample}, ${addUnitTesting},  ${addCIExample}"/>
  <expression name="anyExampleChosen2" value="or(${addExample} ,${addCIExample})"/>
</expressions>


  • note: Because of how Ant works, you need to use the '&amp;&amp;' syntax when you want to use '&&'.
  • note: Expressions 'and(value 1, value 2,...)' and 'or(value 1, value 2,...)' can accept any number of arguments.

String Operations

<expressions>
  <expression name="var" value=" wonderful "/>
  <expression name="myExp" value="concat('hello ',${var},' world')" />
  <expression name="myExp2" >hello wonderful world</expression>
<!--both output 'hello wonderful world' -->
</expressions>


  • note: 'concat(value 1, value 2, value 3,...)' can accept any number of arguments.



expressions

The expressions element is used as a placeholder for your expressions. It can only appear once in your description.xml.


expression

Inside of your expressions tag you can place individual expressions and maps. An expression can be either a simple variable creation or an evaluation. Examples include:

  • if('boolean','use this value if true','use this value if false')
  • concat(value 1, value 2, value 3,...)
  • and(value 1, value 2, ...)
  • or(value 1, value 2, ...)
  • true
  • false
<expressions>
  <!-- simple variable declaration-->
  <expression name="sourceFolder" value="src" />
  <!-- using the concat() expression-->
  <expression name="metaDataExp" value="concat('[SWF(backgroundColor=&quot;',0xFFFFFF,
'&quot;,frameRate=&quot;',bannerFPS(${metaTheme}),'&quot;, width=&quot;',
bannerWidth(${metaTheme}),'&quot;,height=&quot;',bannerHeight(${metaTheme}),
'&quot;)]')" />
   <!-- using an if() expression-->
   <expression name="htmlDesc"
    value="if(${htmlTemplate},
   'This HTML wrapper will create a simple HTML page with 
	your SWF embedded in it.',' ')" />
</expressions>



map

A map (hashmap, hash table, dictionary) is a way to create a collection of key value pairs. This is helpful when creating themes or predefined sets. Whenever a particular theme or set is selected, various variables and values can be changed throughout your template.

<!-- Create a variable (a collection of 'themes') that users can select and change-->
<variable name="metaTheme" label="Application Type"
default="Leaderboard" type="enum('Leaderboard','Full Banner','Half Banner','Full Site')"/>
 
 
<expressions>
  <!-- Create some maps associated with the value of 'metaTheme' -->
  <map name="bannerWidth" >	
	<entry key="Leaderboard" value="'728'"/>
	<entry key="Full Banner" value="'468'"/>
	<entry key="Half Banner" value="'234'"/>
	<entry key="Full Site" value="'800'"/>
  </map>
  <map name="bannerHeight" >	
	<entry key="Leaderboard" value="'90'"/>
	<entry key="Full Banner" value="'60'"/>
	<entry key="Half Banner" value="'60'"/>
	<entry key="Full Site" value="'600'"/>
  </map>
  <map name="bannerFPS"  >
	<entry key="Leaderboard" value="'22'"/>
	<entry key="Full Banner" value="'22'"/>
	<entry key="Half Banner" value="'22'"/>
	<entry key="Full Site" value="'60'"/>
  </map>
<!-- Use the maps and pass to them, as a key, the theme you chose. 
 E.g if 'metaTheme' is equal to 'Leaderboard', 
then 'bannerFPS(${metaTheme})' is equal to 728-->	
  <expression name="metaDataExp" value="concat('[SWF(backgroundColor=&quot;',0xFFFFFF,
'&quot;,frameRate=&quot;',bannerFPS(${metaTheme}),'&quot;, width=&quot;',
bannerWidth(${metaTheme}),'&quot;,height=&quot;',bannerHeight(${metaTheme}),
'&quot;)]')" />
 
</expressions>



Extensions

The extensions tag is used internally by the team to add functionality to templates into the future. When this is developed, more information will added here.



Folders

folders

This tag, and its descendants, is used to define properties of special folders in your project. This is where you define which folders are source folder(s), your output folder, and auto library folder(s). If the folder referenced here doesn't exist when the project is created, FDT will create it.

<folders>	
	<!-- set, or create, a source folder named 'src' -->
	<sourceFolder>src</sourceFolder>
	<!-- set, or create, a source folder named 'src2' -->
	<sourceFolder>src2</sourceFolder>
	<!-- set, or create, an output folder named 'bin-debug' -->
	<outputFolder>bin-debug</outputFolder>
 
	<!-- set, or create, various auto library folders -->
	<autoLibFolder>libs</autoLibFolder>
	<autoLibFolder>libs2</autoLibFolder>
</folders>



sourceFolder

When your project is created, FDT will create a source folder for you.

<folders>
	<!-- set, or create, a source folder named 'src' -->
	<sourceFolder>src</sourceFolder>	
</folders>


Arguments:

  1. if : A boolean value that determines if the folder is created.



outputFolder

When your project is created, FDT will preset your output folder for you.

<folders>
	<!-- set, or create, an output folder named 'bin-debug' -->
	<outputFolder>bin-debug</outputFolder>
</folders>


Arguments:

  1. if : A boolean value that determines if the folder is created.



autoLibFolder

When your project is created, FDT will create an auto library folder for you.

<folders>
	<!-- set, or create, various auto library folders -->
	<autoLibFolder>libs</autoLibFolder>
</folders>

Arguments:

  1. if : A boolean value that determines if the folder is created.



Libraries

libraries

  • note: This tag is best implemented when using linked resources; otherwise, we suggest placing your .SWCs inside of an Auto Library Folder.

Use this tag to define a particular .SWC to be added to your class path upon template generation. .SWC locations are relative to your project root.

<libraries>
  <swc>
    <path>gs/greensock.swc</path>
  </swc>
</libraries>



swc

Adds a .SWC, located within your project, to your source path.

<libraries>
  <swc if="true">
	<path>gs/greensock.swc</path>
  </swc>
</libraries>


Arguments:

  1. if : A boolean value that determines if the .SWC is added to your project's source path.



path

The path for the file alias to exists in your project.

<libraries>
  <swc if="true">
	<path>gs/greensock.swc</path>
  </swc>
</libraries>



Linked Resources

linkedResources

If you have source code, either as .AS files or as .SWCs, located outside of your project, you can use the linkedResources tag to have FDT add it as a linked reference to your project. To make sure it is added to your source path, add a corresponding libraries or sourceFolder element.

<libraries>
  <swc if="${addGreensockLinkedReference}">
	<path>libs/greensock.swc</path>
  </swc>
</libraries>	
 
<linkedResources>
  <linkedFile if="${addGreensockLinkedReference}">
	<path>libs/greensock.swc</path>
	<location>/Users/OSX/_dev/code/greensock-as3/greensock.swc</location>
  </linkedFile>
  <linkedFolder if="${addGreensockSourceCode}">
	<path>gs/src</path>
	<location>/Users/OSX/_dev/code/greensock-as3/src</location>
  </linkedFolder>
</linkedResources>



linkedFile

Within a linkedResources element, use this tag to add a .SWC, that is outside of your project's directory, to your project's source path.

<linkedResources>
  <linkedFile if="true">
	<path>libs/greensock.swc</path>
	<location>/Users/OSX/_dev/code/greensock-as3/greensock.swc</location>
  </linkedFile>
</linkedResources>


Arguments:

  1. if : A boolean value that determines if the .SWC is added to your project's source path.



linkedFolder

Within a linkedResources element, use this tag to add a source folder, that is outside of your project's directory, to your project's source path.

<linkedResources>
  <linkedFolder if="true">
	<path>gs/src</path>
	<location>/Users/OSX/_dev/code/greensock-as3/src</location>
  </linkedFolder>
</linkedResources>


Arguments:

  1. if : A boolean value that determines if the folder is added to your project's source path.



path

The path for the file or folder alias to reference in your project.

<linkedResources>
  <linkedFile if="true">
	<path>libs/greensock.swc</path>
	<location>/Users/OSX/_dev/code/greensock-as3/greensock.swc</location>
  </linkedFile>
  <linkedFolder if="true">
	<path>gs/src</path>
	<location>/Users/OSX/_dev/code/greensock-as3/src</location>
  </linkedFolder>		
</linkedResources>



location

The absolute path where your referenced .SWC or folder exists on your system.

<linkedResources>
  <linkedFile if="true">
	<path>libs/greensock.swc</path>
	<location>/Users/OSX/_dev/code/greensock-as3/greensock.swc</location>
  </linkedFile>
  <linkedFolder if="true">
	<path>gs/src</path>
	<location>/Users/OSX/_dev/code/greensock-as3/src</location>
  </linkedFolder>		
</linkedResources>



locationURI

Use this to include variables on your classpath.

<variables>
  <variable name="pathVar" label="Tweenlite SWC" default="/Users/OSX" type="string"/>
</variables>
 
<linkedResources>
  <linkedFile>
    <path>libs/greensock.swc</path>
    <location>${pathVar}/_dev/code/greensock-as3/greensock.swc</location>
  </linkedFile>
</linkedResources>

Content Creation

contentCreation

Us this tag to specify which files and folders to process and or include. If your template does not have the contentCreation tag, FDT will copy everything inside the project folder into your new project.

<contentCreation processFileExtensions="as,mxml,xml,launch,html" >
 
  <!-- Always -->
  <file src="as/Main.as" dest="src/Main.as" process="true" />
 
  <!-- If HTML Wrapper -->
  <folder src="html-wrapper" dest="${outputFolder}" if="${htmlTemplate}"
	process="true" recursive="true" />
 
  <!-- If Unit Testing -->
  <file src="unitTesting/flexUnitTasks-4.0.0.jar" dest="script/flexUnitTasks-4.0.0.jar"
  	if="${addJar} &amp;&amp; ${addUnitTesting}" />
  <file src="as/TestRunner.as" dest="${testFolderName}/TestRunner.as"
  	if="${addExample} &amp;&amp; ${addUnitTesting}" process="true" />
  <file src="as/SimpleTest.as" dest="${testFolderName}/test/SimpleTest.as"
  	if="${addExample} &amp;&amp; ${addUnitTesting}" />
  <folder src="unitTesting/swc" dest="libs" recursive="true"
  	if="${addUnitTesting}" />
  <folder src="${testFolderName}" recursive="true" if="${addUnitTesting}" />
 
</contentCreation>


Arguments:

  1. processFileExtensions : Add which files types (extensions) you want to be processed.

file

Within the contentCreatation tag is another nested tag file. Use this tag to evaluate whether FDT includes/excludes or processes a file.

<contentCreation processFileExtensions="as,mxml">	
	<file src="as/Main.as" dest="src/MyMain.as" process="true" />
</contentCreation>


Arguments:

  1. src : The location of the file to be accessed & copied (relative to your 'project' folder).
  2. dest : The location of the file that will be outputted into your project.
  3. process : A boolean value whether to have FDT scan the file and replace any variables.
  4. if : A boolean value whether to have FDT to process or copy your file at all.

folder

Also within the contentCreation tag, the folder tag is used to copy an entire directory's contents into your project. It works much like the file tag, but is for folders and their contents.

<contentCreation processFileExtensions="as,mxml">		
	<folder src="unitTesting/swc" dest="libs" recursive="true"
		if="${addUnitTesting}" />
</contentCreation>


Arguments:

  1. src : The location of the folder whose contents will be copied and possibly processed (variables replaced).
  2. dest : The destination folder where the contents will be placed.
  3. process : A boolean value whether to have FDT scan the folder's contents and replace any variables.
  4. if : A boolean value whether to have FDT to evaluate this folder and it's contents at all.
  5. recursive: A boolean value whether FDT should include and process sub folders.



Global Variables

${projectName}

If you use this variable anywhere in your description.xml or your processed files, it will be replaced with the name of your project.

<description>
This template will create a project named '${projectName}' which contains only the basic 
libraries to develop and compile a pure AS3 project.
</description>



${newline}

When working with strings, you can use the ${newline} variable to create a line break.

<description>
This template will create a project named '${projectName}' which contains only the basic 
libraries to develop and compile a pure AS3 project.${newline}${htmlDesc}
</description>


Using newline.png

Misc

antCall

Executes an ant script upon template creation.

<antCall antFile="project/ant/updateLatestLibs.xml"/>


Arguments:

  1. antFile : The location of the file to open. This file should be located inside of your 'project' folder within your template template.
  • note: While other references to project files are relative to your project folder (e.g. using the file tag to process a particular file) this task is relative to the template folder itself. Notice in the example that that project is in the file path.
AntToRun.png


Refresh Button

When using an external editor (e.g. Textmate or Notepad ) to edit your description.xml, it is helpful to have FDT rescan your description.xml for any changes. This is where the 'Refresh' button comes into play.

RefreshButton.png

To add the refresh button, add a <debug/> tag to your order.xml file.

DebugOrderXML.png

Tutorial

You can find here the FDT Project Template Tutorial

Get FDT5