dams            Thu Mar 15 06:32:09 2001 EDT

  Added files:                 
    /phpdoc/en/functions        ming.xml 
  Log:
  Adding Ming documentation.
  

Index: phpdoc/en/functions/ming.xml
+++ phpdoc/en/functions/ming.xml
 <reference id="ref.ming">
  <title>Ming functions for Flash</title>
  <titleabbrev>Ming (flash)</titleabbrev>

  <partintro>
   <simpara>
    This documentation ist not finished yet. Don't start to translate it
    or use it as a programming reference ([EMAIL PROTECTED]).
   </simpara>
   <!--
    DO NOT START TRANSLATING YET!
    THIS DOCUMENTATION IS UNDER TEST 
    There are still a LOT of typos eradicating, and examples
    adding.
    -->
   <simpara>
    These functions are not yet available if PHP. 
   </simpara>
   <sect1 id="ming.intro">
    <title>Introduction</title>
    <simpara>
         Ming is an open-source (LGPL) library which allows you to create SWF
         ("Flash") format movies.  Ming supports almost all of Flash 4's features,
         including: shapes, gradients, bitmaps (pngs and jpegs), morphs ("shape
         tweens"), text, buttons, actions, sprites ("movie clips"), streaming mp3,
         and color transforms--the only thing that's missing is sound events.
    </simpara>
    <simpara>
     Ming is not an acronym. 
    </simpara>
    <simpara>
     Note that all values specifying length, distance, size, etc. are in "twips", 
     twenty units per pixel. That's pretty much arbitrary, though, since the player
     scales the movie to whatever pixel size is specified in the embed/object tag, 
     or the entire frame if not embedded. 
    </simpara>
    <simpara>
         Ming offers a number of advantages over the existing PHP/libswf module.
         You can use Ming anywhere you can compile the code, whereas libswf is
         closed-source and only available for a few platforms, Windows not one of
         them.  Ming provides some insulation from the mundane details of the SWF
         file format, wrapping the movie elements in PHP objects.  Also, Ming is
         still being maintained; if there's a feature that you want to see, just
         let us know <ulink url="mailto:&email.ming;">&email.ming;</ulink>.
    </simpara>
   </sect1>
   
   <sect1 id="ming.install">
    <title>Installation</title>
    <para>
         To use Ming with PHP, you first need to build and install the Ming
         library.  Source code and installation instructions are available at the
         Ming home page : <ulink url="&url.ming;">&url.ming;</ulink>
         along with examples, a small tutorial, and the latest news.
    </para>
    <para>
     Download the ming archive. Unpack the archive. Go in the
     Ming directory. make. make install.
    </para>
    <para>
     This will build libming.so and install it into /usr/lib/, 
     and copy ming.h into /usr/include/. Edit the PREFIX= line 
     in the Makefile to change the installation directory. 
    </para>
    <sect2 id="ming.install.php.unix">
     <title>built into php (unix)</title>
     <para>
      <literallayout>
       mkdir &lt;phpdir>/ext/ming 
       cp php_ext/* &lt;phpdir>/ext/ming 
       cd &lt;phpdir> 
       ./buildconf 
       ./configure --with-ming &lt;other config options> 
       build and install php as usual, 
       restart web server if necessary 
      </literallayout>
     </para>
    </sect2>
    <sect2 id="ming.install.php_module.unix">
     <title>built into php (unix)</title>
     <para>
      <literallayout>
       download php_ming.so.gz 
       uncompress it and copy it to your php modules directory.
       (you can find your php module directory by running php-config --extension-dir).
       Now either just add 'extension=php_ming.so' to your php.ini 
       file, or put 'dl('php_ming.so');' at the head of all of your
       Ming scripts. 
      </literallayout>
     </para>
    </sect2>
   </sect1>
   <sect1 id="ming.use">
    <title>How to use Ming</title>
    <simpara>
     Ming introduces 13 new object in PHP, all with matching methods and 
     attributes. To use them, you need to know about 
     <link linkend="language.oop">objects</link>.
    </simpara>
    <itemizedlist>
     <listitem>
          <simpara>
           <function>swfmovie</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swfshape</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swfdisplayitem</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swfgradient</function>.
      </simpara>
         </listitem>

     <listitem>
          <simpara>
           <function>swfbitmap</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swffill</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swfmorph</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swftext</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swffont</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swftextfield</function>.
      </simpara>
         </listitem>
     <listitem>
          <simpara>
           <function>swfsprite</function>.
      </simpara>
         </listitem>
    <listitem>
          <simpara>
           <function>swfbutton</function>.
      </simpara>
         </listitem>
         <!--
  Commented out, until they are documented.
  Be patient!
     <listitem>
          <simpara>
           <function>swfaction</function>.
      </simpara>
         </listitem>
         -->
    </itemizedlist>
   </sect1>
  </partintro>
  
<!--      SWFMovie  -->

 <refentry id="function.swfmovie">
  <refnamediv>
   <refname>SWFMovie</refname>
   <refpurpose>Creates a new movie object, representing an SWF version 4 
movie.</refpurpose>
  </refnamediv>
  <refsect1>
   <title>Description</title>
   <funcsynopsis>
    <funcprototype>
     <funcdef>new <function>swfmovie</function></funcdef>
      <paramdef>void</paramdef>
    </funcprototype>
   </funcsynopsis>
   <para>
    <function>swfmovie</function> creates a new movie object, 
    representing an SWF version 4 movie.
   </para>
   <simpara>
    SWFMovie has the following methods : 
    <function>swfmovie->output</function>,<function>swfmovie->save</function>,
    <function>swfmovie->add</function>, <function>swfmovie->remove</function>,
    <function>swfmovie->nextframe</function>, 
<function>swfmovie->setbackground</function>,
    <function>swfmovie->setrate</function>, 
<function>swfmovie->setdimension</function>, 
    <function>swfmovie->setframes</function> et 
<function>swfmovie->streammp3</function>.
   </simpara>
   <simpara>
    See examples in : 
    <function>swfdisplayitem->rotateto</function>, 
<function>swfshape->setline</function>,
    <function>swfshape->addfill</function>... Any example will use this object.
   </simpara>
  </refsect1>
 </refentry>
  
  <refentry id="function.swfmovie.output">
   <refnamediv>
    <refname>SWFMovie->output</refname>
    <refpurpose>Dumps your lovingly prepared movie out.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->output</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->output</function> dumps your lovingly prepared movie out. 
     In PHP, preceding this with the command 
     <programlisting role="php">
&lt;?php
header('Content-type: application/x-shockwave-flash'); 
?&gt;
         </programlisting>
     convinces the browser to display this as a flash movie. 
    </para>
    <simpara>
     See also <function>swfmovie->save</function>
    </simpara>
   <simpara>
    See examples in : 
    <function>swfmovie->streammp3</function>, 
<function>swfdisplayitem->rotateto</function>,
    <function>swfaction</function>... Any example will use this method.
   </simpara>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfmovie.save">
   <refnamediv>
    <refname>SWFMovie->save</refname>
    <refpurpose>Saves your movie in a file.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->save</function></funcdef>
      <paramdef>string <parameter>filename</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->save</function> saves your movie to the
     file named <parameter>filename</parameter>. 
    </para>
    <simpara>
     See also <function>output</function>
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfmovie.add">
   <refnamediv>
    <refname>SWFMovie->add</refname>
    <refpurpose>Adds any type of data to a movie.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->add</function></funcdef>
      <paramdef>ressource <parameter>instance</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->add</function> adds <parameter>instance</parameter> to
     the current movie. <parameter>instance</parameter> is any type of data : 
     Shapes, text, fonts, etc. must all be add'ed to the movie to make this work.
    </para>
    <para>
     For displayable types (shape, text, button, sprite), this returns an 
     SWFDisplayItem, a handle to the object in a display list. Thus, you can 
     add the same shape to a movie multiple times and get separate handles 
     back for each separate instance. 
    </para>
    <simpara>
     See also all other objects (adding this later), and
     <function>swfmovie->remove</function>
    </simpara>
    <simpara>
     See examples in : 
     <function>swfdisplayitem->rotateto</function> and 
     <function>swfshape->addfill</function>.
   </simpara>
    
   </refsect1>
  </refentry>

  <refentry id="function.swfmovie.remove">
   <refnamediv>
    <refname>SWFMovie->remove</refname>
    <refpurpose>Removes the object instance from the display list.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->remove</function></funcdef>
      <paramdef>ressource <parameter>instance</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->remove</function> removes the object instance 
     <parameter>instance</parameter> from the display list. 
    </para>
    <simpara>
     See also <function>swfmovie->add</function>
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfmovie.setbackground">
   <refnamediv>
    <refname>SWFMovie->setbackground</refname>
    <refpurpose>Sets the background color.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->setbackground</function></funcdef>
      <paramdef>int <parameter>red</parameter></paramdef>
      <paramdef>int <parameter>green</parameter></paramdef>
      <paramdef>int <parameter>blue</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->setbackground</function> sets the background color. Why is 
     there no rgba version? Think about it. (Actually, that's not such a dumb 
     question after all- you might want to let the html background show through.
     There's a way to do that, but it only works on IE4. Search the MM site for
     details.) 
    </para>
   </refsect1>
  </refentry>
  
   <refentry id="function.swfmovie.setrate">
   <refnamediv>
    <refname>SWFMovie->setrate</refname>
    <refpurpose>Sets the animation's frame rate.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->setrate</function></funcdef>
      <paramdef>int <parameter>rate</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>nom_de_la_fonction</function> sets the frame rate to 
     <parameter>rate</parameter>, in frame per seconds. 
     Animation will slow down if the player can't render frames fast enough- unless 
     there's a streaming sound, in which case display frames are sacrificed to 
     keep sound from skipping. 
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfmovie.setdimension">
   <refnamediv>
    <refname>SWFMovie->setdimension</refname>
    <refpurpose>Sets the movie's width and height.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->setdimension</function></funcdef>
      <paramdef>int <parameter>width</parameter></paramdef>
      <paramdef>int <parameter>height</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->setdimension</function> sets the movie's width 
     to <parameter>width</parameter> and height to <parameter>height</parameter>. 
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfmovie.setframes">
   <refnamediv>
    <refname>SWFMovie->setframes</refname>
    <refpurpose>Sets the total number of frames in the animation.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->setframes</function></funcdef>
      <paramdef>string <parameter>numberofframes</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->setframes</function> sets the total number of frames 
     in the animation to <parameter>numberofframes</parameter>.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfmovie.nextframe">
   <refnamediv>
    <refname>SWFMovie->nextframe</refname>
    <refpurpose>Moves to the next frame of the animation.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->nextframe</function></funcdef>
      <paramdef>void </paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->setframes</function> moves to the next frame of 
     the animation.
    </para>
   </refsect1>
  </refentry>

  
  <refentry id="function.swfmovie.streammp3">
   <refnamediv>
    <refname>SWFMovie->streammp3</refname>
    <refpurpose>Streams a MP3 file.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfmovie->streammp3</function></funcdef>
      <paramdef>string <parameter>mp3FileName</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmovie->streammp3</function> streams the mp3 file 
     <parameter>mp3FileName</parameter>. Not very robust in dealing with 
     oddities (can skip over an initial ID3 tag, but that's about it). 
     Like SWFShape::addJpegFill, this isn't a stable function- we'll 
     probably need to make a separate SWFSound object to contain sound types. 
    </para>
    <para>
     Note that the movie isn't smart enough to put enough frames in to contain 
     the entire mp3 stream- you'll have to add (length of song * frames per second)
     frames to get the entire stream in. 
    </para>
    <para>
     Yes, now you can use ming to put that rock and roll devil worship music
     into your SWF files. Just don't tell the RIAA. 
     <example>
      <title><function>swfmovie->streammp3</function> example</title>
      <programlisting role="php">
&lt;?php
  $m = new SWFMovie();
  $m-&gt;setRate(12.0);
  $m-&gt;streamMp3("distortobass.mp3");
// use your own MP3

  // 11.85 seconds at 12.0 fps = 142 frames
  $m-&gt;setFrames(142);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>

<!--      SWFDisplayItem   -->

  <refentry id="function.swfdisplayitem">
   <refnamediv>
    <refname>SWFDisplayItem</refname>
    <refpurpose>Creates a new displayitem object.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swfdisplayitem</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem</function> creates a new swfdisplayitem object.
    </para>
    <para>
     Here's where all the animation takes place. After you define a shape, 
     a text object, a sprite, or a button, you add it to the movie, then use
     the returned handle to move, rotate, scale, or skew the thing. 
    </para>
    <simpara>
     SWFDisplayItem has the following methods : 
<function>swfdisplayitem->move</function>,
     <function>swfdisplayitem->moveto</function>, 
<function>swfdisplayitem->scaleto</function>, 
     <function>swfdisplayitem->scale</function>, 
<function>swfdisplayitem->rotate</function>, 
     <function>swfdisplayitem->rotateto</function>, 
<function>swfdisplayitem->skewxto</function>, 
     <function>swfdisplayitem->skewx</function>, 
<function>swfdisplayitem->skewyto</function>
     <function>swfdisplayitem->skewyto</function>, 
<function>swfdisplayitem->setdepth</function>
     <function>swfdisplayitem->remove</function>, 
<function>swfdisplayitem->setname</function>
     <function>swfdisplayitem->setratio</function>, 
<function>swfdisplayitem->addcolor</function>
     et <function>swfdisplayitem->multcolor</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.moveto">
   <refnamediv>
    <refname>SWFDisplayItem->moveTo</refname>
    <refpurpose>Moves object in global coordinates.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->moveto</function></funcdef>
      <paramdef>int <parameter>x</parameter></paramdef>
      <paramdef>int <parameter>y</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->moveto</function> moves the current object to 
     (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->move</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.move">
   <refnamediv>
    <refname>SWFDisplayItem->move</refname>
    <refpurpose>Moves object in relative coordinates.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->move</function></funcdef>
      <paramdef>int <parameter>dx</parameter></paramdef>
      <paramdef>int <parameter>dy</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->move</function> moves the current object by 
     (<parameter>dx</parameter>,<parameter>dy</parameter>) from its
     current position.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->moveto</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.scaleto">
   <refnamediv>
    <refname>SWFDisplayItem->scaleTo</refname>
    <refpurpose>Scales the object in global coordinates.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->scaleto</function></funcdef>
      <paramdef>int <parameter>x</parameter></paramdef>
      <paramdef>int <parameter>y</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->scaleto</function> scales the current object to 
     (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->scale</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.scale">
   <refnamediv>
    <refname>SWFDisplayItem->scale</refname>
    <refpurpose>Scales the object in relative coordinates.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->scale</function></funcdef>
      <paramdef>int <parameter>dx</parameter></paramdef>
      <paramdef>int <parameter>dy</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->scale</function> scales the current object by 
     (<parameter>dx</parameter>,<parameter>dy</parameter>) from its
     current position.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->scaleto</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.rotateto">
   <refnamediv>
    <refname>SWFDisplayItem->rotateTo</refname>
    <refpurpose>Rotates the object in global coordinates.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->rotateto</function></funcdef>
      <paramdef>double <parameter>degrees</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->rotateto</function> set the current object
     rotation to <parameter>degrees</parameter> degrees in global coordinates.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <para>
     This example bring three rotating string from the background to the
     foreground. Pretty nice.
     <example>
      <title><function>swfdisplayitem->rotateto</function> example</title>
      <programlisting role="php">
&lt;?php
  $thetext =  "ming!";

  $f = new SWFFont("Bauhaus 93.fdb");

  $m = new SWFMovie();
  $m-&gt;setRate(24.0);
  $m-&gt;setDimension(2400, 1600);
  $m-&gt;setBackground(0xff, 0xff, 0xff);

  // functions with huge numbers of arbitrary
  // arguments are always a good idea!  Really!

  function text($r, $g, $b, $a, $rot, $x, $y, $scale, $string)
  {
    global $f, $m;

    $t = new SWFText();
    $t-&gt;setFont($f);
    $t-&gt;setColor($r, $g, $b, $a);
    $t-&gt;setHeight(960);
    $t-&gt;moveTo(-($f-&gt;getWidth($string))/2, $f-&gt;getAscent()/2);
    $t-&gt;addString($string);

    // we can add properties just like a normal php var,
    // as long as the names aren't already used.
    // e.g., we can't set $i-&gt;scale, because that's a function

    $i = $m-&gt;add($t);
    $i-&gt;x = $x;
    $i-&gt;y = $y;
    $i-&gt;rot = $rot;
    $i-&gt;s = $scale;
    $i-&gt;rotateTo($rot);
    $i-&gt;scale($scale, $scale);

    // but the changes are local to the function, so we have to
    // return the changed object.  kinda weird..

    return $i;
 }

  function step($i)
  {
    $oldrot = $i-&gt;rot;
    $i-&gt;rot = 19*$i-&gt;rot/20;
    $i-&gt;x = (19*$i-&gt;x + 1200)/20;
    $i-&gt;y = (19*$i-&gt;y + 800)/20;
    $i-&gt;s = (19*$i-&gt;s + 1.0)/20;

    $i-&gt;rotateTo($i-&gt;rot);
    $i-&gt;scaleTo($i-&gt;s, $i-&gt;s);
    $i-&gt;moveTo($i-&gt;x, $i-&gt;y);

    return $i;
  }

  // see?  it sure paid off in legibility:

  $i1 = text(0xff, 0x33, 0x33, 0xff, 900, 1200, 800, 0.03, $thetext);
  $i2 = text(0x00, 0x33, 0xff, 0x7f, -560, 1200, 800, 0.04, $thetext);
  $i3 = text(0xff, 0xff, 0xff, 0x9f, 180, 1200, 800, 0.001, $thetext);

  for($i=1; $i<=100; ++$i)
  {
    $i1 = step($i1);
    $i2 = step($i2);
    $i3 = step($i3);

    $m-&gt;nextFrame();
  }

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
    <simpara>
     See also <function>swfdisplayitem->rotate</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.rotate">
   <refnamediv>
    <refname>SWFDisplayItem->Rotate</refname>
    <refpurpose>Rotates in relative coordinates.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->rotate</function></funcdef>
      <paramdef>double <parameter>ddegrees</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->rotate</function> rotates the current object
     by <parameter>ddegrees</parameter> degrees from its current rotation.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->rotateto</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.skewxto">
   <refnamediv>
    <refname>SWFDisplayItem->skewXTo</refname>
    <refpurpose>Sets the X-skew.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->skewxto</function></funcdef>
      <paramdef>double <parameter>degrees</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->skewxto</function> sets the
      x-skew to <parameter>degrees</parameter>. For <parameter>degrees</parameter>
      is  1.0, it means a 45-degree forward slant. More is more forward, 
      less is more backward.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->skewx</function>,
     <function>swfdisplayitem->skewy</function> and 
     <function>swfdisplayitem->skewyto</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.skewx">
   <refnamediv>
    <refname>SWFDisplayItem->skewX</refname>
    <refpurpose>Sets the X-skew.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->skewx</function></funcdef>
      <paramdef>double <parameter>ddegrees</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->skewx</function> adds <parameter>ddegrees</parameter>
     to current x-skew. 
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->skewx</function>,
     <function>swfdisplayitem->skewy</function> and 
     <function>swfdisplayitem->skewyto</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.skewyto">
   <refnamediv>
    <refname>SWFDisplayItem->skewYTo</refname>
    <refpurpose>Sets the Y-skew.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->skewyto</function></funcdef>
      <paramdef>double <parameter>degrees</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->skewyto</function> sets the
     y-skew to <parameter>degrees</parameter>. For <parameter>degrees</parameter>
     is 1.0, it means a 45-degree forward slant. More is more upward, 
     less is more downward.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->skewy</function>,
     <function>swfdisplayitem->skewx</function> and 
     <function>swfdisplayitem->skewxto</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.skewy">
   <refnamediv>
    <refname>SWFDisplayItem->skewY</refname>
    <refpurpose>Sets the Y-skew.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->skewy</function></funcdef>
      <paramdef>double <parameter>ddegrees</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->skewy</function> adds <parameter>ddegrees</parameter>
     to current y-skew. 
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfdisplayitem->skewyto</function>,
     <function>swfdisplayitem->skewx</function> and 
     <function>swfdisplayitem->skewxto</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.setdepth">
   <refnamediv>
    <refname>SWFDisplayItem->setDepth</refname>
    <refpurpose>Sets z-order</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->setdepth</function></funcdef>
      <paramdef>double <parameter>depth</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->rotate</function> sets the object's
     z-order to <parameter>depth</parameter>. Depth defaults to the 
     order in which instances are created (by add'ing a shape/text to 
     a movie)- newer ones are on top of older ones. If two objects are 
     given the same depth, only the later-defined one can be moved. 
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.remove">
   <refnamediv>
    <refname>SWFDisplayItem->remove</refname>
    <refpurpose>Removes the object from the movie</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->remove</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->remove</function> removes this object from
     the movie's display list. 
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <simpara>
     See also <function>swfmovie->add</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfdisplayitem.setname">
   <refnamediv>
    <refname>SWFDisplayItem->setName</refname>
    <refpurpose>Sets the object's name</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->setname</function></funcdef>
      <paramdef>string <parameter>name</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->setname</function> sets the object's name to 
     <parameter>name</parameter>, for targetting with action script. 
     Only useful on sprites. 
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfdisplayitem.setratio">
   <refnamediv>
    <refname>SWFDisplayItem->setRatio</refname>
    <refpurpose>Sets the object's ratio to ratio.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>void <function>swfdisplayitem->setratio</function></funcdef>
      <paramdef>double <parameter>ratio</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->setratio</function> sets the object's ratio
     to <parameter>ratio</parameter>. Obviously only useful for morphs. 
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <para>
     This simple example will morph nicely three concentric circles.
     <example>
      <title><function>swfdisplayitem->setname</function> example</title>
      <programlisting role="php">
&lt;?php

  $p = new SWFMorph();

  $g = new SWFGradient();
  $g-&gt;addEntry(0.0, 0, 0, 0);
  $g-&gt;addEntry(0.16, 0xff, 0xff, 0xff);
  $g-&gt;addEntry(0.32, 0, 0, 0);
  $g-&gt;addEntry(0.48, 0xff, 0xff, 0xff);
  $g-&gt;addEntry(0.64, 0, 0, 0);
  $g-&gt;addEntry(0.80, 0xff, 0xff, 0xff);
  $g-&gt;addEntry(1.00, 0, 0, 0);

  $s = $p-&gt;getShape1();
  $f = $s-&gt;addFill($g, SWFFILL_RADIAL_GRADIENT);
  $f-&gt;scaleTo(0.05);
  $s-&gt;setLeftFill($f);
  $s-&gt;movePenTo(-160, -120);
  $s-&gt;drawLine(320, 0);
  $s-&gt;drawLine(0, 240);
  $s-&gt;drawLine(-320, 0);
  $s-&gt;drawLine(0, -240);

  $g = new SWFGradient();
  $g-&gt;addEntry(0.0, 0, 0, 0);
  $g-&gt;addEntry(0.16, 0xff, 0, 0);
  $g-&gt;addEntry(0.32, 0, 0, 0);
  $g-&gt;addEntry(0.48, 0, 0xff, 0);
  $g-&gt;addEntry(0.64, 0, 0, 0);
  $g-&gt;addEntry(0.80, 0, 0, 0xff);
  $g-&gt;addEntry(1.00, 0, 0, 0);

  $s = $p-&gt;getShape2();
  $f = $s-&gt;addFill($g, SWFFILL_RADIAL_GRADIENT);
  $f-&gt;scaleTo(0.05);
  $f-&gt;skewXTo(1.0);
  $s-&gt;setLeftFill($f);
  $s-&gt;movePenTo(-160, -120);
  $s-&gt;drawLine(320, 0);
  $s-&gt;drawLine(0, 240);
  $s-&gt;drawLine(-320, 0);
  $s-&gt;drawLine(0, -240);

  $m = new SWFMovie();
  $m-&gt;setDimension(320, 240);
  $i = $m-&gt;add($p);
  $i-&gt;moveTo(160, 120);

  for($n=0; $n<=1.001; $n+=0.01)
  {
    $i-&gt;setRatio($n);
    $m-&gt;nextFrame();
  }

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfdisplayitem.addcolor">
   <refnamediv>
    <refname>SWFDisplayItem->addColor</refname>
    <refpurpose>Adds the given color to this item's color transform.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->addcolor</function></funcdef>
      <paramdef>integer <parameter><optional>red</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>green</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>blue</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->addcolor</function> adds the color to 
     this item's color transform. The color is given in its RGB form.
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
   </refsect1>
  </refentry> 

  <refentry id="function.swfdisplayitem.multcolor">
   <refnamediv>
    <refname>SWFDisplayItem->multColor</refname>
    <refpurpose>Multiplies the item's color transform.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfdisplayitem->multcolor</function></funcdef>
      <paramdef>integer <parameter><optional>red</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>green</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>blue</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfdisplayitem->multcolor</function> multiplies the item's 
     color transform by the given values. 
    </para>
    <simpara>
     The object may be a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function> or a 
     <function>swfsprite</function> object. It must have been added using
     the <function>swfmovie->add</function>.
    </simpara>
    <para>
     This simple example will modify your picture's atmospher
     to Halloween (use a landscape or bright picture).
     <example>
      <title><function>swfdisplayitem->multcolor</function> example</title>
      <programlisting role="php">
&lt;?php

  $b = new SWFBitmap("backyard.jpg");
  // note use your own picture :-)
  $s = new SWFShape();
  $s-&gt;setRightFill($s-&gt;addFill($b));
  $s-&gt;drawLine($b-&gt;getWidth(), 0);
  $s-&gt;drawLine(0, $b-&gt;getHeight());
  $s-&gt;drawLine(-$b-&gt;getWidth(), 0);
  $s-&gt;drawLine(0, -$b-&gt;getHeight());

  $m = new SWFMovie();
  $m-&gt;setDimension($b-&gt;getWidth(), $b-&gt;getHeight());

  $i = $m-&gt;add($s);

  for($n=0; $n<=20; ++$n)
  {
    $i-&gt;multColor(1.0-$n/10, 1.0, 1.0);
    $i-&gt;addColor(0xff*$n/20, 0, 0);
    $m-&gt;nextFrame();
  }

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry> 
  
<!--      SWFShape  -->

  <refentry id="function.swfshape">
   <refnamediv>
    <refname>SWFShape</refname>
    <refpurpose>Creates a new shape object.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swfshape</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfshape</function> creates a new shape object.
    </para>
    <simpara>
     SWFShape has the following methods : <function>swfshape->setline</function>,
     <function>swfshape->addfill</function>, 
<function>swfshape->setleftfile</function>, 
     <function>swfshape->setrightfile</function>, 
<function>swfshape->movepento</function>, 
     <function>swfshape->movepen</function>, 
<function>swfshape->drawlineto</function>, 
     <function>swfshape->drawline</function>, 
<function>swfshape->drawcurveto</function>
     et <function>swfshape->drawcurve</function>.
    </simpara>
    <para>
     This simple example will draw a big red elliptic quadrant.
     <example>
      <title><function>swfshape</function> example</title>
      <programlisting role="php">
&lt;?php
  $s = new SWFShape();
  $s-&gt;setLine(40, 0x7f, 0, 0);
  $s-&gt;setRightFill($s-&gt;addFill(0xff, 0, 0));
  $s-&gt;movePenTo(200, 200);
  $s-&gt;drawLineTo(6200, 200);
  $s-&gt;drawLineTo(6200, 4600);
  $s-&gt;drawCurveTo(200, 4600, 200, 200);

  $m = new SWFMovie();
  $m-&gt;setDimension(6400, 4800);
  $m-&gt;setRate(12.0);
  $m-&gt;add($s);
  $m-&gt;nextFrame();

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfshape.setline">
   <refnamediv>
    <refname>SWFShape->setLine</refname>
    <refpurpose>Sets the shape's line style.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>bool <function>swfshape->setline</function></funcdef>
      <paramdef>int <parameter>width</parameter></paramdef>
      <paramdef>integer <parameter><optional>red</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>green</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>blue</optional></parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfshape->setline</function> sets the shape's line style. 
     <parameter>width</parameter> is the line's width. If <parameter>width</parameter>
     is 0, the line's style is removed (then, all other arguments are ignored).
     If <parameter>width</parameter> > 0, then line's color is set to
     <parameter>red</parameter>, <parameter>green</parameter>, 
<parameter>blue</parameter>.
     Last parameter <parameter>a</parameter> is optional.
    </para>
    <simpara>
     <function>swfshape->setline</function> accepts 1, 4 or 5 arguments 
     (not 3 or 2).
    </simpara>
    <para>
     You must declare all line styles before you use them (see example).
    </para>
    <para>
     This simple example will draw a big "!#%*@", in funny colors and
     gracious style.
     <example>
      <title><function>swfshape->setline</function> example</title>
      <programlisting role="php">
&lt;?php
  $s = new SWFShape();
  $f1 = $s-&gt;addFill(0xff, 0, 0);
  $f2 = $s-&gt;addFill(0xff, 0x7f, 0);
  $f3 = $s-&gt;addFill(0xff, 0xff, 0);
  $f4 = $s-&gt;addFill(0, 0xff, 0);
  $f5 = $s-&gt;addFill(0, 0, 0xff);

  // bug: have to declare all line styles before you use them
  $s-&gt;setLine(40, 0x7f, 0, 0);
  $s-&gt;setLine(40, 0x7f, 0x3f, 0);
  $s-&gt;setLine(40, 0x7f, 0x7f, 0);
  $s-&gt;setLine(40, 0, 0x7f, 0);
  $s-&gt;setLine(40, 0, 0, 0x7f);

  $f = new SWFFont('Techno.fdb');

  $s-&gt;setRightFill($f1);
  $s-&gt;setLine(40, 0x7f, 0, 0);
  $s-&gt;drawGlyph($f, '!');
  $s-&gt;movePen($f-&gt;getWidth('!'), 0);

  $s-&gt;setRightFill($f2);
  $s-&gt;setLine(40, 0x7f, 0x3f, 0);
  $s-&gt;drawGlyph($f, '#');
  $s-&gt;movePen($f-&gt;getWidth('#'), 0);

  $s-&gt;setRightFill($f3);
  $s-&gt;setLine(40, 0x7f, 0x7f, 0);
  $s-&gt;drawGlyph($f, '%');
  $s-&gt;movePen($f-&gt;getWidth('%'), 0);

  $s-&gt;setRightFill($f4);
  $s-&gt;setLine(40, 0, 0x7f, 0);
  $s-&gt;drawGlyph($f, '*');
  $s-&gt;movePen($f-&gt;getWidth('*'), 0);

  $s-&gt;setRightFill($f5);
  $s-&gt;setLine(40, 0, 0, 0x7f);
  $s-&gt;drawGlyph($f, '@');

  $m = new SWFMovie();
  $m-&gt;setDimension(3000,2000);
  $m-&gt;setRate(12.0);
  $i = $m-&gt;add($s);
  $i-&gt;moveTo(1500-$f-&gt;getWidth("!#%*@")/2, 1000+$f-&gt;getAscent()/2);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfshape.addfill">
   <refnamediv>
    <refname>SWFShape->addFill</refname>
    <refpurpose>Adds a solid fill to the shape.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->addfill</function></funcdef>
      <paramdef>integer <parameter>red</parameter></paramdef>
      <paramdef>integer <parameter>green</parameter></paramdef>
      <paramdef>integer <parameter>blue</parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->addfill</function></funcdef>
      <paramdef>SWFbitmap <parameter>bitmap</parameter></paramdef>
      <paramdef>integer <parameter><optional>flags</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->addfill</function></funcdef>
      <paramdef>SWFGradient <parameter>gradient</parameter></paramdef>
      <paramdef>integer <parameter><optional>flags</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfshape->addfill</function> adds a solid fill to the shape's list 
     of fill styles. <function>swfshape->addfill</function> accepts three different
     types of arguments.
    </para>
    <para>
     <parameter>red</parameter>, <parameter>green</parameter>, 
<parameter>blue</parameter>
     is a color (RGB mode). Last parameter <parameter>a</parameter> is optional.
    </para>
    <para>
     The <parameter>bitmap</parameter> argument is an <function>swfbitmap</function> 
object.
     The <parameter>flags</parameter> argument can be one
     of the following values : SWFFILL_CLIPPED_BITMAP or SWFFILL_TILED_BITMAP. 
     Default is SWFFILL_TILED_BITMAP. I think. 
    </para>
    <para>
     The <parameter>gradient</parameter> argument is an 
<function>swfgradient</function> 
     object. The flags argument can be one of the following values :  
     SWFFILL_RADIAL_GRADIENT or SWFFILL_LINEAR_GRADIENT. Default is 
     SWFFILL_LINEAR_GRADIENT. I'm sure about this one. Really. 
    </para>
    <para>
     <function>swfshape->addfill</function> returns an <function>swffill</function>
     object for use with the <function>swfshape->setfill</function> functions 
     described below. 
    </para>
    <simpara>
     See also <function>swfshape->setfill</function>.
    </simpara>
    <para>
     This simple example will draw a frame on a bitmap. Ah, here's another buglet in 
     the flash player- it doesn't seem to care about the second shape's bitmap's
     transformation in a morph. According to spec, the bitmap should stretch 
     along with the shape in this example.. 
     <example>
      <title><function>swfshape->addfill</function> example</title>
      <programlisting role="php">
&lt;?php

  $p = new SWFMorph();

  $b = new SWFBitmap("alphafill.jpg");
  // use your own bitmap
  $width = $b-&gt;getWidth();
  $height = $b-&gt;getHeight();

  $s = $p-&gt;getShape1();
  $f = $s-&gt;addFill($b, SWFFILL_TILED_BITMAP);
  $f-&gt;moveTo(-$width/2, -$height/4);
  $f-&gt;scaleTo(1.0, 0.5);
  $s-&gt;setLeftFill($f);
  $s-&gt;movePenTo(-$width/2, -$height/4);
  $s-&gt;drawLine($width, 0);
  $s-&gt;drawLine(0, $height/2);
  $s-&gt;drawLine(-$width, 0);
  $s-&gt;drawLine(0, -$height/2);

  $s = $p-&gt;getShape2();
  $f = $s-&gt;addFill($b, SWFFILL_TILED_BITMAP);

  // these two have no effect!
  $f-&gt;moveTo(-$width/4, -$height/2);
  $f-&gt;scaleTo(0.5, 1.0);

  $s-&gt;setLeftFill($f);
  $s-&gt;movePenTo(-$width/4, -$height/2);
  $s-&gt;drawLine($width/2, 0);
  $s-&gt;drawLine(0, $height);
  $s-&gt;drawLine(-$width/2, 0);
  $s-&gt;drawLine(0, -$height);

  $m = new SWFMovie();
  $m-&gt;setDimension($width, $height);
  $i = $m-&gt;add($p);
  $i-&gt;moveTo($width/2, $height/2);

  for($n=0; $n<1.001; $n+=0.03)
  {
    $i-&gt;setRatio($n);
    $m-&gt;nextFrame();
  }

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfshape.setleftfill">
   <refnamediv>
    <refname>SWFShape->setLeftFill</refname>
    <refpurpose>Sets left rasterizing color.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->setleftfill</function></funcdef>
      <paramdef>swfgradient <parameter>fill</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->setleftfill</function></funcdef>
      <paramdef>integer <parameter>red</parameter></paramdef>
      <paramdef>integer <parameter>green</parameter></paramdef>
      <paramdef>integer <parameter>blue</parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     What this nonsense is about is, every edge segment borders at most two fills. 
     When rasterizing the object, it's pretty handy to know what those fills are 
     ahead of time, so the swf format requires these to be specified. 
    </para>
    <para>
     <function>swfshape->setleftfill</function> sets the fill on the left side of 
     the edge- that is, on the interior if you're defining the outline of the shape in 
a counter-clockwise
     fashion. The fill object is an SWFFill object returned from one of the addFill
     functions above. 
    </para>
    <para>
     This seems to be reversed when you're defining a shape in a morph, though. 
     If your browser crashes, just try setting the fill on the other side. 
    </para>
    <simpara>
     Shortcut for <literal>swfshape->setleftfill($s->addfill($r, $g, $b [, 
$a]));</literal>. 
    </simpara>
    <simpara>
     See also <function>swfshape->setrightfill</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfshape.setrightfill">
   <refnamediv>
    <refname>SWFShape->setRightFill</refname>
    <refpurpose>Sets right rasterizing color.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->setrightfill</function></funcdef>
      <paramdef>swfgradient <parameter>fill</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->setrightfill</function></funcdef>
      <paramdef>integer <parameter>red</parameter></paramdef>
      <paramdef>integer <parameter>green</parameter></paramdef>
      <paramdef>integer <parameter>blue</parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     See also <function>swfshape->setleftfill</function>.
    </simpara>
    <simpara>
     Shortcut for <literal>swfshape->setrightfill($s->addfill($r, $g, $b [, 
$a]));</literal>. 
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfshape.movepento">
   <refnamediv>
    <refname>SWFShape->movePenTo</refname>
    <refpurpose>Moves the shape's pen.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->movepento</function></funcdef>
      <paramdef>integer <parameter>x</parameter></paramdef>
      <paramdef>integer <parameter>y</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>swfshape->setrightfill</function> move the shape's pen to
     (<parameter>x</parameter>,<parameter>y</parameter>) in the shape's 
     coordinate space. 
    </simpara>
    <simpara>
     See also 
     <function>swfshape->movepen</function>,
     <function>swfshape->drawcurveto</function>,
     <function>swfshape->drawlineto</function> et 
     <function>swfshape->drawline</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfshape.movepen">
   <refnamediv>
    <refname>SWFShape->movePen</refname>
    <refpurpose>Moves the shape's pen (relative).</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->movepen</function></funcdef>
      <paramdef>integer <parameter>dx</parameter></paramdef>
      <paramdef>integer <parameter>dy</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>swfshape->setrightfill</function> move the shape's pen from
     coordinates (current x,current y) to (current x + <parameter>dx</parameter>,
     current y + <parameter>dy</parameter>) in the shape's coordinate space. 
    </simpara>
    <simpara>
     See also 
     <function>swfshape->movepento</function>,
     <function>swfshape->drawcurveto</function>,
     <function>swfshape->drawlineto</function> et 
     <function>swfshape->drawline</function>.
    </simpara>
   </refsect1>
  </refentry>
    
  <refentry id="function.swfshape.drawlineto">
   <refnamediv>
    <refname>SWFShape->drawLineTo</refname>
    <refpurpose>Draws a line.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->drawlineto</function></funcdef>
      <paramdef>integer <parameter>x</parameter></paramdef>
      <paramdef>integer <parameter>y</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>swfshape->setrightfill</function> draws a line (using the 
     current line style, set by <function>swfshape->setline</function>) from the 
current 
     pen position to point (<parameter>x</parameter>,<parameter>y</parameter>) 
     in the shape's coordinate space. 
    </simpara>
    <simpara>
     See also 
     <function>swfshape->movepento</function>,
     <function>swfshape->drawcurveto</function>,
     <function>swfshape->movepen</function> et 
     <function>swfshape->drawline</function>.
    </simpara>
   </refsect1>
  </refentry>

  <refentry id="function.swfshape.drawline">
   <refnamediv>
    <refname>SWFShape->drawLine</refname>
    <refpurpose>Draws a line (relative).</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->drawline</function></funcdef>
      <paramdef>integer <parameter>dx</parameter></paramdef>
      <paramdef>integer <parameter>dy</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>swfshape->setrightfill</function> draws a line (using the current line 
style
     set by <function>swfshape->setline</function>) from the current pen position to 
     displacement (<parameter>dx</parameter>,<parameter>dy</parameter>).
    </simpara>
    <simpara>
     See also 
     <function>swfshape->movepento</function>,
     <function>swfshape->drawcurveto</function>,
     <function>swfshape->movepen</function> et 
     <function>swfshape->drawlineto</function>.
    </simpara>
   </refsect1>
  </refentry>    

  <refentry id="function.swfshape.drawcurveto">
   <refnamediv>
    <refname>SWFShape->drawCurveTo</refname>
    <refpurpose>Draws a curve.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->drawcurveto</function></funcdef>
      <paramdef>integer <parameter>controlx</parameter></paramdef>
      <paramdef>integer <parameter>controly</parameter></paramdef>
      <paramdef>integer <parameter>anchorx</parameter></paramdef>
      <paramdef>integer <parameter>anchory</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>swfshape->drawcurveto</function> draws a quadratic curve 
     (using the current line style, set by <function>swfshape->setline</function>)
     from the current pen position to 
     (<parameter>anchorx</parameter>,<parameter>anchory</parameter>) 
     using (<parameter>controlx</parameter>,<parameter>controly</parameter>)
     as a control point. That is, head towards the control point, 
     then smoothly turn to the anchor point.
    </simpara>
    <simpara>
     See also 
     <function>swfshape->drawlineto</function>,
     <function>swfshape->drawline</function>,
     <function>swfshape->movepento</function> et 
     <function>swfshape->movepen</function>.
    </simpara>
   </refsect1>
  </refentry>  

  <refentry id="function.swfshape.drawcurve">
   <refnamediv>
    <refname>SWFShape->drawCurve</refname>
    <refpurpose>Draws a curve (relative).</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfshape->drawcurve</function></funcdef>
      <paramdef>integer <parameter>controldx</parameter></paramdef>
      <paramdef>integer <parameter>controldy</parameter></paramdef>
      <paramdef>integer <parameter>anchordx</parameter></paramdef>
      <paramdef>integer <parameter>anchordy</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <simpara>
     <function>swfshape->drawcurve</function> draws a quadratic curve 
     (using the current line style,set by <function>swfshape->setline</function>) 
     from the current pen position to the relative position
     (<parameter>anchorx</parameter>,<parameter>anchory</parameter>) 
     using relative control point 
     (<parameter>controlx</parameter>,<parameter>controly</parameter>).
     That is, head towards the control point, then smoothly turn to the
     anchor point.
    </simpara>
    <simpara>
     See also 
     <function>swfshape->drawlineto</function>,
     <function>swfshape->drawline</function>,
     <function>swfshape->movepento</function> et 
     <function>swfshape->movepen</function>.
    </simpara>
   </refsect1>
  </refentry>

<!--      SWFGradient  -->
  
  <refentry id="function.swfgradient">
   <refnamediv>
    <refname>SWFGradient</refname>
    <refpurpose>Loads a font definition</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swfgradient</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfgradient</function> creates a new SWFGradient object.
    </para>
    <simpara>
     After you've added the entries to your gradient, you can use the gradient 
     in a shape fill with the <function>swfshape->addfill</function> method. 
    </simpara>
    <simpara>
     SWFGradient has the following methods : 
<function>swfgradient->addentry</function>.
    </simpara>
    <para>
     This simple example will draw a big black-to-white gradient as background,
     and a redish disc in its center.
     <example>
      <title><function>swfgradient</function> example</title>
      <programlisting role="php">
&lt;?php

  $m = new SWFMovie();
  $m-&gt;setDimension(320, 240);

  $s = new SWFShape();

  // first gradient- black to white
  $g = new SWFGradient();
  $g-&gt;addEntry(0.0, 0, 0, 0);
  $g-&gt;addEntry(1.0, 0xff, 0xff, 0xff);

  $f = $s-&gt;addFill($g, SWFFILL_LINEAR_GRADIENT);
  $f-&gt;scaleTo(0.01);
  $f-&gt;moveTo(160, 120);
  $s-&gt;setRightFill($f);
  $s-&gt;drawLine(320, 0);
  $s-&gt;drawLine(0, 240);
  $s-&gt;drawLine(-320, 0);
  $s-&gt;drawLine(0, -240);

  $m-&gt;add($s);

  $s = new SWFShape();

  // second gradient- radial gradient from red to transparent
  $g = new SWFGradient();
  $g-&gt;addEntry(0.0, 0xff, 0, 0, 0xff);
  $g-&gt;addEntry(1.0, 0xff, 0, 0, 0);

  $f = $s-&gt;addFill($g, SWFFILL_RADIAL_GRADIENT);
  $f-&gt;scaleTo(0.005);
  $f-&gt;moveTo(160, 120);
  $s-&gt;setRightFill($f);
  $s-&gt;drawLine(320, 0);
  $s-&gt;drawLine(0, 240);
  $s-&gt;drawLine(-320, 0);
  $s-&gt;drawLine(0, -240);

  $m-&gt;add($s);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>
    
  <refentry id="function.swfgradient.addentry">
   <refnamediv>
    <refname>SWFGradient->addEntry</refname>
    <refpurpose>Adds an entry to the gradient list.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfgradient->addentry</function></funcdef>
      <paramdef>double <parameter>ratio</parameter></paramdef>
      <paramdef>integer <parameter>red</parameter></paramdef>
      <paramdef>integer <parameter>green</parameter></paramdef>
      <paramdef>integer <parameter>blue</parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfgradient->addentry</function> adds an entry to the gradient list. 
     <parameter>ratio</parameter> is a number between 0 and 1 indicating where in 
     the gradient this color appears. Thou shalt add entries in order of increasing 
ratio. 
    </para>
    <para>
     <parameter>red</parameter>, <parameter>green</parameter>, 
<parameter>blue</parameter>
     is a color (RGB mode). Last parameter <parameter>a</parameter> is optional.
    </para>
   </refsect1>
  </refentry>

<!--      SWFBitmap  -->
  
  <refentry id="function.swfbitmap">
   <refnamediv>
    <refname>SWFBitmap</refname>
    <refpurpose>Loads Bitmap object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swfbitmap</function></funcdef>
      <paramdef>string <parameter>filename</parameter></paramdef>
      <paramdef>integer 
<parameter><optional>alphafilename</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbitmap</function> creates a new SWFBitmap object from 
     the Jpeg or DBL file named <parameter>filename</parameter>. 
     <parameter>alphafilename</parameter> indicates a MSK file to
     be used as an alpha mask for a Jpeg image. 
    </para>
    <note>
     <para>
      We can only deal with baseline (frame 0) jpegs, no baseline optimized or 
      progressive scan jpegs! 
     </para>
    </note>
    <simpara>
     SWFBitmap has the following methods : <function>swfbitmap->getwidth</function>
     and <function>swfbitmap->getheight</function>.
    </simpara>
    <para>
     You can't import png images directly, though- have to use the png2dbl 
     utility to make a dbl ("define bits lossless") file from the png. 
     The reason for this is that I don't want a dependency on the png library 
     in ming- autoconf should solve this, but that's not set up yet. 
     <example>
      <title>Import PNG files</title>
      <programlisting role="php">
&lt;?php
  $s = new SWFShape();
  $f = $s-&gt;addFill(new SWFBitmap("png.dbl"));
  $s-&gt;setRightFill($f);

  $s-&gt;drawLine(32, 0);
  $s-&gt;drawLine(0, 32);
  $s-&gt;drawLine(-32, 0);
  $s-&gt;drawLine(0, -32);

  $m = new SWFMovie();
  $m-&gt;setDimension(32, 32);
  $m-&gt;add($s);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
    <para>
     And you can put an alpha mask on a jpeg fill.
     <example>
      <title><function>swfbitmap</function> example</title>
      <programlisting role="php">
&lt;?php

  $s = new SWFShape();

  // .msk file generated with "gif2mask" utility
  $f = $s-&gt;addFill(new SWFBitmap("alphafill.jpg", "alphafill.msk"));
  $s-&gt;setRightFill($f);

  $s-&gt;drawLine(640, 0);
  $s-&gt;drawLine(0, 480);
  $s-&gt;drawLine(-640, 0);
  $s-&gt;drawLine(0, -480);

  $c = new SWFShape();
  $c-&gt;setRightFill($c-&gt;addFill(0x99, 0x99, 0x99));
  $c-&gt;drawLine(40, 0);
  $c-&gt;drawLine(0, 40);
  $c-&gt;drawLine(-40, 0);
  $c-&gt;drawLine(0, -40);

  $m = new SWFMovie();
  $m-&gt;setDimension(640, 480);
  $m-&gt;setBackground(0xcc, 0xcc, 0xcc);

  // draw checkerboard background
  for($y=0; $y<480; $y+=40)
  {
    for($x=0; $x<640; $x+=80)
    {
      $i = $m-&gt;add($c);
      $i-&gt;moveTo($x, $y);
    }

    $y+=40;

    for($x=40; $x<640; $x+=80)
    {
      $i = $m-&gt;add($c);
      $i-&gt;moveTo($x, $y);
    }
  }

  $m-&gt;add($s);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>
    
  <refentry id="function.swfbitmap.getwidth">
   <refnamediv>
    <refname>SWFBitmap->getWidth</refname>
    <refpurpose>Returns the bitmap's width.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swfbitmap->getwidth</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbitmap->getwidth</function> returns the bitmap's width in pixels.
    </para>
    <para>
     See also <function>swfbitmap->getheight</function>.
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfbitmap.getheight">
   <refnamediv>
    <refname>SWFBitmap->getHeight</refname>
    <refpurpose>Returns the bitmap's height.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swfbitmap->getheight</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbitmap->getheight</function> returns the bitmap's height in pixels. 
    </para>
    <para>
     See also <function>swfbitmap->getwidth</function>.
    </para>
   </refsect1>
  </refentry>

<!--      SWFFill  -->
  
  <refentry id="function.swffill">
   <refnamediv>
    <refname>SWFFill</refname>
    <refpurpose>Loads SWFFill object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <para>
     The <function>swffill</function> object allows you to transform 
     (scale, skew, rotate) bitmap and gradient fills. <function>swffill</function>
     objects are created by the <function>swfshape->addfill</function> methods. 
    </para>
    <simpara>
     SWFFill has the following methods : <function>swffill->moveto</function>
     and <function>swffill->scaleto</function>, 
<function>swffill->rotateto</function>, 
     <function>swffill->skewxto</function> and <function>swffill->skewyto</function>.
    </simpara>
   </refsect1>
  </refentry>
    
  <refentry id="function.swffill.moveto">
   <refnamediv>
    <refname>SWFFill->moveTo</refname>
    <refpurpose>Moves fill origin</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swffill->moveto</function></funcdef>
      <paramdef>integer <parameter>x</parameter></paramdef>
      <paramdef>integer <parameter>y</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swffill->moveto</function> moves fill's origin to 
     (<parameter>x</parameter>,<parameter>y</parameter>) in global coordinates. 
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swffill.scaleto">
   <refnamediv>
    <refname>SWFFill->scaleTo</refname>
    <refpurpose>Sets fill's scale</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swffill->scaleto</function></funcdef>
      <paramdef>integer <parameter>x</parameter></paramdef>
      <paramdef>integer <parameter>y</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swffill->scaleto</function> sets fill's scale to 
     <parameter>x</parameter> in the x-direction, 
     <parameter>y</parameter> in the y-direction. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swffill.rotateto">
   <refnamediv>
    <refname>SWFFill->rotateTo</refname>
    <refpurpose>Sets fill's rotation</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swffill->rotateto</function></funcdef>
      <paramdef>double <parameter>degrees</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swffill->rotateto</function> sets fill's rotation to 
     <parameter>degrees</parameter> degrees. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swffill.skewxto">
   <refnamediv>
    <refname>SWFFill->skewXTo</refname>
    <refpurpose>Sets fill x-skew</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swffill->skewxto</function></funcdef>
      <paramdef>double <parameter>x</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swffill->skewxto</function> sets fill x-skew to 
<parameter>x</parameter>.
     For <parameter>x</parameter> is 1.0, it is a is a 45-degree 
     forward slant. More is more forward, less is more backward. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swffill.skewyto">
   <refnamediv>
    <refname>SWFFill->skewYTo</refname>
    <refpurpose>Sets fill y-skew</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swffill->skewyto</function></funcdef>
      <paramdef>double <parameter>y</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swffill->skewyto</function> sets fill y-skew to 
<parameter>y</parameter>.
     For <parameter>y</parameter> is 1.0, it is a is a 45-degree 
     upward slant. More is more upward, less is more downward. 
    </para>
   </refsect1>
  </refentry>

<!--      SWFMorph  -->
  
  <refentry id="function.swfmorph">
   <refnamediv>
    <refname>SWFMorph</refname>
    <refpurpose>Creates a new SWFMorph object.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swfmorph</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmorph</function> creates a new SWFMorph object. 
    </para>
    <para>
     Also called a "shape tween". This thing lets you make those tacky 
     twisting things that make your computer choke. Oh, joy! 
    </para>
    <para>
     The methods here are sort of weird. It would make more sense to just 
     have newSWFMorph(shape1, shape2);, but as things are now, shape2 needs
     to know that it's the second part of a morph. (This, because it starts
     writing its output as soon as it gets drawing commands- if it kept its
     own description of its shapes and wrote on completion this and some 
     other things would be much easier.) 
    </para>
    <simpara>
     SWFMorph has the following methods : <function>swfmorph->getshape1</function>
     and <function>swfmorph->getshape1</function>.
    </simpara>
    <para>
     This simple example will morph a big red square into a smaller
     blue black-bordered square.
     <example>
      <title><function>swfmorph</function> example</title>
      <programlisting role="php">
&lt;?php
  $p = new SWFMorph();

  $s = $p-&gt;getShape1();
  $s-&gt;setLine(0,0,0,0);

  /* Note that this is backwards from normal shapes (left instead of right).
     I have no idea why, but this seems to work.. */

  $s-&gt;setLeftFill($s-&gt;addFill(0xff, 0, 0));
  $s-&gt;movePenTo(-1000,-1000);
  $s-&gt;drawLine(2000,0);
  $s-&gt;drawLine(0,2000);
  $s-&gt;drawLine(-2000,0);
  $s-&gt;drawLine(0,-2000);

  $s = $p-&gt;getShape2();
  $s-&gt;setLine(60,0,0,0);
  $s-&gt;setLeftFill($s-&gt;addFill(0, 0, 0xff));
  $s-&gt;movePenTo(0,-1000);
  $s-&gt;drawLine(1000,1000);
  $s-&gt;drawLine(-1000,1000);
  $s-&gt;drawLine(-1000,-1000);
  $s-&gt;drawLine(1000,-1000);

  $m = new SWFMovie();
  $m-&gt;setDimension(3000,2000);
  $m-&gt;setBackground(0xff, 0xff, 0xff);

  $i = $m-&gt;add($p);
  $i-&gt;moveTo(1500,1000);

  for($r=0.0; $r<=1.0; $r+=0.1)
  {
    $i-&gt;setRatio($r);
    $m-&gt;nextFrame();
  }

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>
    
  <refentry id="function.swfmorph.getshape1">
   <refnamediv>
    <refname>SWFMorph->getshape1</refname>
    <refpurpose>Gets a handle to the starting shape</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swfmorph->getshape1</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmorph->getshape1</function> gets a handle to the morph's
     starting shape. <function>swfmorph->getshape1</function> returns an 
     <function>swfshape</function> object. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfmorph.getshape2">
   <refnamediv>
    <refname>SWFMorph->getshape2</refname>
    <refpurpose>Gets a handle to the ending shape</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swfmorph->getshape2</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfmorph->getshape2</function> gets a handle to the morph's
     ending shape. <function>swfmorph->getshape2</function> returns an 
     <function>swfshape</function> object. 
    </para>
   </refsect1>
  </refentry>

<!--      SWFText  -->
  
  <refentry id="function.swftext">
   <refnamediv>
    <refname>SWFMorph</refname>
    <refpurpose>Creates a new SWFText object.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swftext</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftext</function> creates a new SWFText object,
     fresh for manipulating. 
    </para>
    <simpara>
     SWFText has the following methods : <function>swftext->setfont</function>,
     <function>swftext->setheight</function>, <function>swftext->setspacing</function>,
     <function>swftext->setcolor</function>, <function>swftext->moveto</function>,
     <function>swftext->addstring</function> and 
<function>swftext->getwidth</function>.
    </simpara>
    <para>
     This simple example will draw a big yellow "PHP generates Flash with Ming"
     text, on white background.
     <example>
      <title><function>swftext</function> example</title>
      <programlisting role="php">
&lt;?php
  $f = new SWFFont("Techno.fdb");
  $t = new SWFText();
  $t-&gt;setFont($f);
  $t-&gt;moveTo(200, 2400);
  $t-&gt;setColor(0xff, 0xff, 0);
  $t-&gt;setHeight(1200);
  $t-&gt;addString("PHP generates Flash with Ming!!");

  $m = new SWFMovie();
  $m-&gt;setDimension(5400, 3600);

  $m-&gt;add($t);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>
    
  <refentry id="function.swftext.setfont">
   <refnamediv>
    <refname>SWFText->setFont</refname>
    <refpurpose>Sets the current font</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftext->setfont</function></funcdef>
      <paramdef>string <parameter>font</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftext->setfont</function> sets the current font to 
     <parameter>font</parameter>. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftext.setheight">
   <refnamediv>
    <refname>SWFText->setHeight</refname>
    <refpurpose>Sets the current font heigh</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftext->setheight</function></funcdef>
      <paramdef>integer <parameter>height</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftext->setheight</function> sets the current font height to 
     <parameter>height</parameter>. Default is 240. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftext.setspacing">
   <refnamediv>
    <refname>SWFText->setSpacing</refname>
    <refpurpose>Sets the current font spacing</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftext->setspacing</function></funcdef>
      <paramdef>double <parameter>spacing</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftext->setspacing</function> sets the current font spacing to 
     <parameter>spacing</parameter><parameter>spacing</parameter>. Default is 1.0. 
     0 is all of the letters written at the same point. This doesn't really work 
     that well because it inflates the advance across the letter, doesn't add 
     the same amount of spacing between the letters. I should try and explain 
     that better, prolly. Or just fix the damn thing to do constant spacing. 
     This was really just a way to figure out how letter advances work, 
     anyway.. So nyah. 
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swftext.setcolor">
   <refnamediv>
    <refname>SWFText->setColor</refname>
    <refpurpose>Sets the current font heigh</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftext->setcolor</function></funcdef>
      <paramdef>integer <parameter>red</parameter></paramdef>
      <paramdef>integer <parameter>green</parameter></paramdef>
      <paramdef>integer <parameter>blue</parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftext->setspacing</function> changes the current text color. 
     Default is black. I think. Color is represented using the RGB system.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftext.moveto">
   <refnamediv>
    <refname>SWFText->moveTo</refname>
    <refpurpose>Moves the pen</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftext->moveto</function></funcdef>
      <paramdef>integer <parameter>x</parameter></paramdef>
      <paramdef>integer <parameter>y</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftext->moveto</function> moves the pen (or cursor, if 
     that makes more sense) to (<parameter>x</parameter>,<parameter>y</parameter>)
     in text object's coordinate space. If either is zero, though, value 
     in that dimension stays the same. Annoying, should be fixed. 
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swftext.addstring">
   <refnamediv>
    <refname>SWFText->addString</refname>
    <refpurpose>Draws a string</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftext->addstring</function></funcdef>
      <paramdef>string <parameter>string</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftext->addstring</function> draws the string 
<parameter>string</parameter>
     at the current pen (cursor) location. Pen is at the baseline of the text; 
     i.e., ascending text is in the -y direction. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftext.getwidth">
   <refnamediv>
    <refname>SWFText->getWidth</refname>
    <refpurpose>Computes string's width</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftext->addstring</function></funcdef>
      <paramdef>string <parameter>string</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftext->addstring</function> returns the rendered width of the
     <parameter>string</parameter> string at the text object's current font, 
     scale, and spacing settings. 
    </para>
   </refsect1>
  </refentry>

<!--      SWFFont  -->
  
  <refentry id="function.swffont">
   <refnamediv>
    <refname>SWFFont</refname>
    <refpurpose>Loads a font definition</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swffont</function></funcdef>
      <paramdef>string <parameter>filename</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     If name is the name of an FDB file (i.e., it ends in ".fdb"), load the font 
     definition found in said file. Otherwise, create a browser-defined font 
reference. 
    </para>
    <para>
     FDB ("font definition block") is a very simple wrapper for the SWF DefineFont2
     block which contains a full description of a font. One may create FDB files from 
     SWT Generator template files with the included makefdb utility- look in the 
     util directory off the main ming distribution directory. 
    </para>
    <para>
     Browser-defined fonts don't contain any information about the font other 
     than its name. It is assumed that the font definition will be provided by
     the movie player. The fonts _serif, _sans, and _typewriter should always 
     be available. For example: 
     <programlisting role="php">
&lt;?php
$f = newSWFFont("_sans"); 
?&gt;
         </programlisting>
         will give you the standard sans-serif font, probably the same as what you'd 
get
         with &lt;font name="sans-serif"&gt; in HTML.
        </para>
        <para>
         Returns a reference to the font definition, for use in the SWFText setFont 
method 
         and the SWFTextField setFont method. 
    </para>
    <simpara>
     SWFFont has the following methods : <function>swffont->getwidth</function>.
    </simpara>
   </refsect1>
  </refentry>
    
  <refentry id="function.swffont.getwidth">
   <refnamediv>
    <refname>getwidth</refname>
    <refpurpose>Returns the string's width</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swffont->getwidth</function></funcdef>
      <paramdef>string <parameter>string</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>nom_de_la_fonction</function> returns the string 
     <parameter>string</parameter>'s width, using font's default scaling. 
     You'll probably want to use the SWFText version of this method which
     uses the text object's scale. 
    </para>
   </refsect1>
  </refentry>

<!--      SWFTextField  -->
  
  <refentry id="function.swftextfield">
   <refnamediv>
    <refname>SWFTextField</refname>
    <refpurpose>Creates a text field object</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swftextfield</function></funcdef>
      <paramdef>int <parameter><optional>flags</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
         <function>swftextfield</function> creates a new text field object. 
         Text Fields are less flexible than <function>swftext</function> objects- 
         they can't be rotated, scaled non-proportionally, or skewed, but they can
         be used as form entries, and they can use browser-defined fonts.
        </para>
        <para>
         The optional flags change the text field's behavior. It has the following
         possibles values : 
         <itemizedlist>
          <listitem>
           <simpara>
            SWFTEXTFIELD_NOEDIT : indicates that the field shouldn't be user-editable
           </simpara>
          </listitem>
          <listitem>
           <simpara>
            SWFTEXTFIELD_PASSWORD obscures the data entry
           </simpara>
          </listitem>
          <listitem>
           <simpara>
            SWFTEXTFIELD_DRAWBOX draws the outline of the textfield
           </simpara>
          </listitem>
          <listitem>
           <simpara>
            SWFTEXTFIELD_MULTILINE allows multiple lines
           </simpara>
          </listitem>
          <listitem>
           <simpara>
            SWFTEXTFIELD_WORDWRAP allows text to wrap
           </simpara>
          </listitem>
          <listitem>
           <simpara>
            SWFTEXTFIELD_NOSELECT makes the field non-selectable 
           </simpara>
          </listitem>
         </itemizedlist>
         Flags are combined with the bitwise OR operation. For example, 
         <programlisting role="php">
&lt;?php
$t = newSWFTextField(SWFTEXTFIELD_PASSWORD | SWFTEXTFIELD_NOEDIT); 
?&gt;
     </programlisting>
      creates a totally useless non-editable password field. 
    </para>
    <simpara>
     SWFTextField has the following methods : 
<function>swftextfield->setfont</function>,
     <function>swftextfield->setbounds</function>, 
<function>swftextfield->align</function>, 
     <function>swftextfield->setheight</function>, 
<function>swftextfield->setleftmargin</function>, 
     <function>swftextfield->setrightmargin</function>, 
<function>swftextfield->setmargins</function>, 
     <function>swftextfield->setindentation</function>, 
<function>swftextfield->setlinespacing</function>, 
     <function>swftextfield->setcolor</function>, 
<function>swftextfield->setname</function> et 
     <function>swftextfield->addstring</function>.
    </simpara>
   </refsect1>
  </refentry>
    
  <refentry id="function.swftextfield.setfont">
   <refnamediv>
    <refname>SWFTextField->setFont</refname>
    <refpurpose>Sets the text field font</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setfont</function></funcdef>
      <paramdef>string <parameter>font</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setfont</function> sets the text field font to 
     the [browser-defined?] <parameter>font</parameter> font. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftextfield.setbounds">
   <refnamediv>
    <refname>SWFTextField->setbounds</refname>
    <refpurpose>Sets the text field width and height</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setbounds</function></funcdef>
      <paramdef>int <parameter>width</parameter></paramdef>
      <paramdef>int <parameter>height</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setbounds</function> sets the text field width 
     to <parameter>width</parameter> and height to <parameter>height</parameter>.
     If you don't set the bounds yourself, Ming makes a poor guess at what 
     the bounds are. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftextfield.align">
   <refnamediv>
    <refname>SWFTextField->align</refname>
    <refpurpose>Sets the text field width and height</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->align</function></funcdef>
      <paramdef>int <parameter>alignement</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->align</function> sets the text field alignment
     to <parameter>alignement</parameter>. Valid values for 
     <parameter>alignement</parameter> are: SWFTEXTFIELD_ALIGN_LEFT, 
     SWFTEXTFIELD_ALIGN_RIGHT, SWFTEXTFIELD_ALIGN_CENTER and 
     SWFTEXTFIELD_ALIGN_JUSTIFY.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftextfield.setheight">
   <refnamediv>
    <refname>SWFTextField->setHeight</refname>
    <refpurpose>Sets the font height of this text field font.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setheight</function></funcdef>
      <paramdef>int <parameter>height</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setheight</function> sets the font height of this text 
field
     font to the given height <parameter>height</parameter>. Default is 240.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftextfield.setleftmargin">
   <refnamediv>
    <refname>SWFTextField->setLeftMargin</refname>
    <refpurpose>Sets the left margin width of the text field.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setleftmargin</function></funcdef>
      <paramdef>int <parameter>width</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setleftmargin</function> sets the left margin width
     of the text field to <parameter>width</parameter>. Default is 0.
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swftextfield.setrightmargin">
   <refnamediv>
    <refname>SWFTextField->setrightMargin</refname>
    <refpurpose>Sets the right margin width of the text field.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setrightmargin</function></funcdef>
      <paramdef>int <parameter>width</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setrightmargin</function> sets the right margin width
     of the text field to <parameter>width</parameter>. Default is 0.
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swftextfield.setmargins">
   <refnamediv>
    <refname>SWFTextField->setMargins</refname>
    <refpurpose>Sets the margins width of the text field.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setmargins</function></funcdef>
      <paramdef>int <parameter>left</parameter></paramdef>
      <paramdef>int <parameter>right</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setmargins</function> set both margins at once, 
     for the man on the go. 
    </para>
   </refsect1>
  </refentry>  
  
  <refentry id="function.swftextfield.setindentation">
   <refnamediv>
    <refname>SWFTextField->setindentation</refname>
    <refpurpose>Sets the indentation of the first line.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setindentation</function></funcdef>
      <paramdef>int <parameter>width</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setindentation</function> sets the indentation of 
     the first line in the text field, to <parameter>width</parameter>.
    </para>
   </refsect1>
  </refentry> 

  <refentry id="function.swftextfield.setlinespacing">
   <refnamediv>
    <refname>SWFTextField->setLineSpacing</refname>
    <refpurpose>Sets the line spacing of the text field.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setlinespacing</function></funcdef>
      <paramdef>int <parameter>height</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setlinespacing</function> sets the line spacing
     of the text field to the height of <parameter>height</parameter>. Default is 40. 
    </para>
   </refsect1>
  </refentry> 

  <refentry id="function.swftextfield.setcolor">
   <refnamediv>
    <refname>SWFTextField->setcolor</refname>
    <refpurpose>Sets the color of the text field. </refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setcolor</function></funcdef>
      <paramdef>integer <parameter>red</parameter></paramdef>
      <paramdef>integer <parameter>green</parameter></paramdef>
      <paramdef>integer <parameter>blue</parameter></paramdef>
      <paramdef>integer <parameter><optional>a</optional></parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setcolor</function> sets the color of the text field. 
     Default is fully opaque black. Color is represented using RGB system.
    </para>
   </refsect1>
  </refentry> 

  <refentry id="function.swftextfield.setname">
   <refnamediv>
    <refname>SWFTextField->setname</refname>
    <refpurpose>Sets the variable name</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->setname</function></funcdef>
      <paramdef>string <parameter>name</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setname</function> sets the variable name of this
     text field to <parameter>name</parameter>, for form posting and action 
     scripting purposes. 
    </para>
   </refsect1>
  </refentry> 
  
  <refentry id="function.swftextfield.addstring">
   <refnamediv>
    <refname>SWFTextField->addstring</refname>
    <refpurpose>Concatenates the given string to the text field</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>int <function>swftextfield->addstring</function></funcdef>
      <paramdef>string <parameter>string</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swftextfield->setname</function> concatenates the string
     <parameter>string</parameter> to the text field. 
    </para>
   </refsect1>
  </refentry> 
  
<!--      SWFSprite   -->
  
  <refentry id="function.swfsprite">
   <refnamediv>
    <refname>SWFSprite</refname>
    <refpurpose>Creates a movie clip (a sprite)</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swfsprite</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     SWFSprite are also known as a "movie clip", this allows one to create objects
     which are animated in their own timelines. Hence, the sprite has most of the
     same methods as the movie. 
    </para>
    <simpara>
     SWFSprite has the following methods : <function>swfsprite->add</function>,
     <function>swfsprite->remove</function>, <function>swfsprite->nextframe</function>
     <function>swfsprite->setframes</function>.
    </simpara>
    <para>
     This simple example will spin gracefully a big red square.
     <example>
      <title><function>swfsprite</function> example</title>
      <programlisting role="php">
&lt;?php
  $s = new SWFShape();
  $s-&gt;setRightFill($s-&gt;addFill(0xff, 0, 0));
  $s-&gt;movePenTo(-500,-500);
  $s-&gt;drawLineTo(500,-500);
  $s-&gt;drawLineTo(500,500);
  $s-&gt;drawLineTo(-500,500);
  $s-&gt;drawLineTo(-500,-500);

  $p = new SWFSprite();
  $i = $p-&gt;add($s);
  $p-&gt;nextFrame();
  $i-&gt;rotate(15);
  $p-&gt;nextFrame();
  $i-&gt;rotate(15);
  $p-&gt;nextFrame();
  $i-&gt;rotate(15);
  $p-&gt;nextFrame();
  $i-&gt;rotate(15);
  $p-&gt;nextFrame();
  $i-&gt;rotate(15);
  $p-&gt;nextFrame();

  $m = new SWFMovie();
  $i = $m-&gt;add($p);
  $i-&gt;moveTo(1500,1000);
  $i-&gt;setName("blah");

  $m-&gt;setBackground(0xff, 0xff, 0xff);
  $m-&gt;setDimension(3000,2000);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>
    
  <refentry id="function.swfsprite.add">
   <refnamediv>
    <refname>SWFSprite->add</refname>
    <refpurpose>Adds an object to a sprite</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfsprite->add</function></funcdef>
      <paramdef>ressource <parameter>object</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfsprite->add</function> adds a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function>, 
     a <function>swfaction</function> or a <function>swfsprite</function> object. 
    </para>
    <para>
     For displayable types (<function>swfshape</function>,
     <function>swfbutton</function>, <function>swftext</function>, 
     <function>swfaction</function> or <function>swfsprite</function>),
     this returns a handle  to the object in a display list. 
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfsprite.remove">
   <refnamediv>
    <refname>SWFSprite->remove</refname>
    <refpurpose>Removes an object to a sprite</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfsprite->remove</function></funcdef>
      <paramdef>ressource <parameter>object</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfsprite->remove</function> remove a <function>swfshape</function>, a 
     <function>swfbutton</function>, a <function>swftext</function>, 
     a <function>swfaction</function> or a <function>swfsprite</function> object
     from the sprite. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfsprite.setframes">
   <refnamediv>
    <refname>SWFSprite->setframes</refname>
    <refpurpose>Sets the total number of frames in the animation.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfsprite->setframes</function></funcdef>
      <paramdef>string <parameter>numberofframes</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfsprite->setframes</function> sets the total number of frames 
     in the animation to <parameter>numberofframes</parameter>.
    </para>
   </refsect1>
  </refentry>
  
  <refentry id="function.swfsprite.nextframe">
   <refnamediv>
    <refname>SWFSprite->nextframe</refname>
    <refpurpose>Moves to the next frame of the animation.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfsprite->nextframe</function></funcdef>
      <paramdef>void </paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfsprite->setframes</function> moves to the next frame of 
     the animation.
    </para>
   </refsect1>
  </refentry>

<!--      SWFButton   -->
  
  <refentry id="function.swfbutton">
   <refnamediv>
    <refname>SWFbutton</refname>
    <refpurpose>Creates a new Button.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swfbutton</function></funcdef>
      <paramdef>void</paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbutton</function> creates a new Button. 
     Roll over it, click it, see it call action code. Swank. 
    </para>
    <simpara>
     SWFButton has the following methods : <function>swfbutton->addshape</function>,
     <function>swfbutton->setup</function>, <function>swfbutton->setover</function>
     <function>swfbutton->setdown</function>, <function>swfbutton->sethit</function>
     <function>swfbutton->setaction</function> and 
     <function>swfbutton->addaction</function>.
    </simpara>
    <para>
     This simple example will show your usual interactions with buttons : 
     rollover, rollon, mouseup, mousedown, noaction.
     <example>
      <title><function>swfbutton</function> example</title>
      <programlisting role="php">
&lt;?php

  $f = new SWFFont("_serif");

  $p = new SWFSprite();

  function label($string)
  {
    global $f;

    $t = new SWFTextField();
    $t-&gt;setFont($f);
    $t-&gt;addString($string);
    $t-&gt;setHeight(200);
    $t-&gt;setBounds(3200,200);
    return $t;
  }
  function addLabel($string)
  {
    global $p;

    $i = $p-&gt;add(label($string));
    $p-&gt;nextFrame();
    $p-&gt;remove($i);
  }

  $p-&gt;add(new SWFAction("stop();"));
  addLabel("NO ACTION");
  addLabel("SWFBUTTON_MOUSEUP");
  addLabel("SWFBUTTON_MOUSEDOWN");
  addLabel("SWFBUTTON_MOUSEOVER");
  addLabel("SWFBUTTON_MOUSEOUT");
  addLabel("SWFBUTTON_MOUSEUPOUTSIDE");
  addLabel("SWFBUTTON_DRAGOVER");
  addLabel("SWFBUTTON_DRAGOUT");

  function rect($r, $g, $b)
  {
    $s = new SWFShape();
    $s-&gt;setRightFill($s-&gt;addFill($r, $g, $b));
    $s-&gt;drawLine(600,0);
    $s-&gt;drawLine(0,600);
    $s-&gt;drawLine(-600,0);
    $s-&gt;drawLine(0,-600);

    return $s;
  }

  $b = new SWFButton();
  $b-&gt;addShape(rect(0xff, 0, 0), SWFBUTTON_UP | SWFBUTTON_HIT);
  $b-&gt;addShape(rect(0, 0xff, 0), SWFBUTTON_OVER);
  $b-&gt;addShape(rect(0, 0, 0xff), SWFBUTTON_DOWN);

  $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(1);"),
                SWFBUTTON_MOUSEUP);

  $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(2);"),
                SWFBUTTON_MOUSEDOWN);

  $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(3);"),
                SWFBUTTON_MOUSEOVER);

  $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(4);"),
                SWFBUTTON_MOUSEOUT);

  $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(5);"),
                SWFBUTTON_MOUSEUPOUTSIDE);

  $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(6);"),
                SWFBUTTON_DRAGOVER);

  $b-&gt;addAction(new SWFAction("setTarget('/label'); gotoFrame(7);"),
                SWFBUTTON_DRAGOUT);

  $m = new SWFMovie();
  $m-&gt;setDimension(4000,3000);

  $i = $m-&gt;add($p);
  $i-&gt;setName("label");
  $i-&gt;moveTo(400,1900);

  $i = $m-&gt;add($b);
  $i-&gt;moveTo(400,900);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
    <para>
     This simple example will enables you to drag draw a big red button
     on the windows. No drag-and-drop, just moving around.
     <example>
      <title><function>swfbutton->addaction</function> example</title>
      <programlisting role="php">
&lt;?php

  $s = new SWFShape();
  $s-&gt;setRightFill($s-&gt;addFill(0xff, 0, 0));
  $s-&gt;drawLine(1000,0);
  $s-&gt;drawLine(0,1000);
  $s-&gt;drawLine(-1000,0);
  $s-&gt;drawLine(0,-1000);

  $b = new SWFButton();
  $b-&gt;addShape($s, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER);

  $b-&gt;addAction(new SWFAction("startDrag('/test', 0);"), // '0' means don't lock to 
mouse
                SWFBUTTON_MOUSEDOWN);

  $b-&gt;addAction(new SWFAction("stopDrag();"),
                SWFBUTTON_MOUSEUP | SWFBUTTON_MOUSEUPOUTSIDE);

  $p = new SWFSprite();
  $p-&gt;add($b);
  $p-&gt;nextFrame();

  $m = new SWFMovie();
  $i = $m-&gt;add($p);
  $i-&gt;setName('test');
  $i-&gt;moveTo(1000,1000);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
   </refsect1>
  </refentry>
    
  <refentry id="function.swfbutton.addshape">
   <refnamediv>
    <refname>SWFbutton->addShape</refname>
    <refpurpose>Adds an object to a sprite</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfbutton->addshape</function></funcdef>
      <paramdef>ressource <parameter>shape</parameter></paramdef>
      <paramdef>integer <parameter>flags</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbutton->addshape</function> adds the shape 
     <parameter>shape</parameter> to this button. The following flags are valid: 
     SWFBUTTON_UP, SWFBUTTON_OVER, SWFBUTTON_DOWN or SWFBUTTON_HIT.
     SWFBUTTON_HIT isn't ever displayed, it defines the hit region for the button.
     That is, everywhere the hit shape would be drawn is considered a "touchable" 
     part of the button. 
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfbutton.setup">
   <refnamediv>
    <refname>SWFbutton->setUp</refname>
    <refpurpose>Alias for addShape(shape, SWFBUTTON_UP)</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfbutton->setup</function></funcdef>
      <paramdef>ressource <parameter>shape</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbutton->setup</function> alias for addShape(shape, SWFBUTTON_UP).
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfbutton.setover">
   <refnamediv>
    <refname>SWFbutton->setOver</refname>
    <refpurpose>Alias for addShape(shape, SWFBUTTON_OVER)</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfbutton->setover</function></funcdef>
      <paramdef>ressource <parameter>shape</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbutton->setup</function> alias for addShape(shape, SWFBUTTON_OVER).
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfbutton.sethit">
   <refnamediv>
    <refname>SWFbutton->setHit</refname>
    <refpurpose>Alias for addShape(shape, SWFBUTTON_HIT)</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfbutton->sethit</function></funcdef>
      <paramdef>ressource <parameter>shape</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbutton->sethit</function> alias for addShape(shape, SWFBUTTON_HIT).
    </para>
   </refsect1>
  </refentry>

  <refentry id="function.swfbutton.setAction">
   <refnamediv>
    <refname>SWFbutton->setAction</refname>
    <refpurpose>Sets the action</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>string <function>swfbutton->setaction</function></funcdef>
      <paramdef>ressource <parameter>action</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfbutton->setaction</function> sets the action to be performed
     when the button is clicked. Alias for addAction(shape, SWFBUTTON_MOUSEUP).
     <parameter>action</parameter> is a <function>swfaction</function>.
    </para>
   </refsect1>
  </refentry>

<!--      SWFAction   -->
  
  <refentry id="function.swfaction">
   <refnamediv>
    <refname>SWFAction</refname>
    <refpurpose>Creates a new Action.</refpurpose>
   </refnamediv>
   <refsect1>
    <title>Description</title>
    <funcsynopsis>
     <funcprototype>
      <funcdef>new <function>swfbutton</function></funcdef>
      <paramdef>string <parameter>script</parameter></paramdef>
     </funcprototype>
    </funcsynopsis>
    <para>
     <function>swfaction</function> creates a new Action, and
     compiles the given script into an SWFAction object. 
    </para>
    <para>
     The script syntax is based on the C language, but with a lot taken out- the SWF
     bytecode machine is just too simpleminded to do a lot of things we might like. 
     For instance, we can't implement function calls without a tremendous 
     amount of hackery because the jump bytecode has a hardcoded offset 
     value. No pushing your calling address to the stack and returning- 
     every function would have to know exactly where to return to. 
    </para>
    <para>
     So what's left? The compiler recognises the following tokens: 
     <itemizedlist>
      <listitem>
       <simpara>
        break
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        for
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        continue
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        if
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        else
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        do
       </simpara>
      </listitem>
      <listitem>
       <simpara>
        while
       </simpara>
      </listitem>
     </itemizedlist>
    </para>
    <para>
     There is no typed data; all values in the SWF action machine are stored as 
strings. 
     The following functions can be used in expressions: 
     <variablelist>
      <varlistentry>
       <term>time()</term>
       <listitem>
            <simpara>
         Returns the number of milliseconds (?) elapsed since the movie started. 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>random(seed)</term>
       <listitem>
            <simpara>
             Returns a pseudo-random number in the range 0-seed.
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>length(expr)</term>
       <listitem>
            <simpara>
             Returns the length of the given expression. 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>int(number)</term>
       <listitem>
            <simpara>
             Returns the given number rounded down to the nearest integer. 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>concat(expr, expr)</term>
       <listitem>
            <simpara>
             Returns the concatenation of the given expressions. 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>ord(expr)</term>
       <listitem>
            <simpara>
             Returns the ASCII code for the given character 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>chr(num)</term>
       <listitem>
            <simpara>
             Returns the character for the given ASCII code 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>substr(string, location, length)</term>
       <listitem>
            <simpara>
             Returns the substring of length length at location location of 
             the given string string.
            </simpara>
       </listitem>
      </varlistentry>
     </variablelist>
    </para>
    <para>
     Additionally, the following commands may be used: 
     <variablelist>
      <varlistentry>
       <term>duplicateClip(clip, name, depth)</term>
       <listitem>
            <simpara>
             Duplicate the named movie clip (aka sprite). The new movie clip has name 
name 
             and is at depth depth. 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>removeClip(expr)</term>
       <listitem>
            <simpara>
             Removes the named movie clip. 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>trace(expr)</term>
       <listitem>
            <simpara>
             Write the given expression to the trace log. Doubtful that the browser
             plugin does anything with this. 
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>startDrag(target, lock, [left, top, right, bottom])</term>
       <listitem>
            <simpara>
             Start dragging the movie clip target. The lock argument indicates whether 
             to lock the mouse (?)- use 0 (false) or 1 (true). Optional parameters 
             define a bounding area for the dragging.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>stopDrag()</term>
       <listitem>
            <simpara>
             Stop dragging my heart around. And this movie clip, too.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>callFrame(expr)</term>
       <listitem>
            <simpara>
             Call the named frame as a function.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>getURL(url, target, [method])</term>
       <listitem>
            <simpara>
             Load the given url into the named target. The target argument can be a 
         frame name (I think), or one of the magical values "_level0" (replaces 
         current movie) or "_level1" (loads new movie on top of current movie). 
         The optional method argument can be post or get if you want to submit 
         variables back to the server.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>loadMovie(url, target)</term>
       <listitem>
            <simpara>
             Same as above, more or less. Come to think of it, I don't quite know what 
             the difference is.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>nextFrame()</term>
       <listitem>
            <simpara>
             Go to the next frame.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>prevFrame()</term>
       <listitem>
            <simpara>
             Go to the last (or, rather, previous) frame.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>play()</term>
       <listitem>
            <simpara>
             Start playing the movie.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>stop()</term>
       <listitem>
            <simpara>
             Stop playing the movie.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>toggleQuality()</term>
       <listitem>
            <simpara>
             Toggle between high and low quality.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>stopSounds()</term>
       <listitem>
            <simpara>
             Stop playing all sounds.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>gotoFrame(num)</term>
       <listitem>
            <simpara>
             Go to frame number num. Frame numbers start at 0.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>gotoFrame(name)</term>
       <listitem>
            <simpara>
             Go to the frame named name. Which does a lot of good, since I 
             haven't added frame labels yet.  
            </simpara>
       </listitem>
      </varlistentry>
      <varlistentry>
       <term>setTarget(expr)</term>
       <listitem>
            <simpara>
             Sets the context for action. Or so they say- I really have no 
             idea what this does. 
            </simpara>
       </listitem>   
      </varlistentry>
     </variablelist>
     And there's one weird extra thing. The expression frameLoaded(num) can be used
     in if statements and while loops to check if the given frame number has been
     loaded yet. Well, it's supposed to, anyway, but I've never tested it and I
     seriously doubt it actually works. You can just use /:framesLoaded instead. 
    </para>
    <para>
      Movie clips (all together now- aka sprites) have properties. You can 
      read all of them (or can you?), you can set some of them, and here 
      they are: 
      <itemizedlist>
       <listitem>
        <simpara>
         x
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         y 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         xScale 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         yScale 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         currentFrame - (read-only) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         totalFrames - (read-only) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         alpha - transparency level 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         visible - 1=on, 0=off (?) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         width - (read-only) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         height - (read-only) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         rotation 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         target - (read-only) (???) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         framesLoaded - (read-only) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         name 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         dropTarget - (read-only) (???) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         url - (read-only) (???) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         highQuality - 1=high, 0=low (?) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         focusRect - (???) 
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         soundBufTime - (???) 
        </simpara>
       </listitem>
      </itemizedlist>
      So, setting a sprite's x position is as simple as /box.x = 100;. 
      Why the slash in front of the box, though? That's how flash keeps
      track of the sprites in the movie, just like a unix filesystem- 
      here it shows that box is at the top level. If the sprite named 
      box had another sprite named biff inside of it, you'd set its x 
      position with /box/biff.x = 100;. At least, I think so; correct 
      me if I'm wrong here. 
    </para>
    <para>
     This simple example will move the red square across the window.
     <example>
      <title><function>swfaction</function> example</title>
      <programlisting role="php">
&lt;?php
 $s = new SWFShape();
  $f = $s-&gt;addFill(0xff, 0, 0);
  $s-&gt;setRightFill($f);

  $s-&gt;movePenTo(-500,-500);
  $s-&gt;drawLineTo(500,-500);
  $s-&gt;drawLineTo(500,500);
  $s-&gt;drawLineTo(-500,500);
  $s-&gt;drawLineTo(-500,-500);

  $p = new SWFSprite();
  $i = $p-&gt;add($s);
  $i-&gt;setDepth(1);
  $p-&gt;nextFrame();

  for($n=0; $n<5; ++$n)
  {
    $i-&gt;rotate(-15);
    $p-&gt;nextFrame();
  }

  $m = new SWFMovie();
  $m-&gt;setBackground(0xff, 0xff, 0xff);
  $m-&gt;setDimension(6000,4000);

  $i = $m-&gt;add($p);
  $i-&gt;setDepth(1);
  $i-&gt;moveTo(-500,2000);
  $i-&gt;setName("box");

  $m-&gt;add(new SWFAction("/box.x += 3;"));
  $m-&gt;nextFrame();
  $m-&gt;add(new SWFAction("gotoFrame(0); play();"));
  $m-&gt;nextFrame();

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
    <para>
     This simple example tracks down your mouse on the screen.
     <example>
      <title><function>swfaction</function> example</title>
      <programlisting role="php">
&lt;?php

  $m = new SWFMovie();
  $m-&gt;setRate(36.0);
  $m-&gt;setDimension(1200, 800);
  $m-&gt;setBackground(0, 0, 0);

  /* mouse tracking sprite - empty, but follows mouse so we can
     get its x and y coordinates */

  $i = $m-&gt;add(new SWFSprite());
  $i-&gt;setName('mouse');

  $m-&gt;add(new SWFAction("
    startDrag('/mouse', 1); /* '1' means lock sprite to the mouse */
  "));


  /* might as well turn off antialiasing, since these are just squares. */

  $m-&gt;add(new SWFAction("
    this.quality = 0;
  "));

  /* morphing box */
  $r = new SWFMorph();
  $s = $r-&gt;getShape1();

  /* Note this is backwards from normal shapes.  No idea why. */
  $s-&gt;setLeftFill($s-&gt;addFill(0xff, 0xff, 0xff));
  $s-&gt;movePenTo(-40, -40);
  $s-&gt;drawLine(80, 0);
  $s-&gt;drawLine(0, 80);
  $s-&gt;drawLine(-80, 0);
  $s-&gt;drawLine(0, -80);

  $s = $r-&gt;getShape2();

  $s-&gt;setLeftFill($s-&gt;addFill(0x00, 0x00, 0x00));
  $s-&gt;movePenTo(-1, -1);
  $s-&gt;drawLine(2, 0);
  $s-&gt;drawLine(0, 2);
  $s-&gt;drawLine(-2, 0);
  $s-&gt;drawLine(0, -2);


  /* sprite container for morphing box -
     this is just a timeline w/ the box morphing */

  $box = new SWFSprite();
  $box-&gt;add(new SWFAction("
    stop();
  "));
  $i = $box-&gt;add($r);

  for($n=0; $n<=20; ++$n)
  {
    $i-&gt;setRatio($n/20);
    $box-&gt;nextFrame();
  }


  /* this container sprite allows us to use the same action code many times */

  $cell = new SWFSprite();
  $i = $cell-&gt;add($box);
  $i-&gt;setName('box');

  $cell-&gt;add(new SWFAction("

    setTarget('box');

    /* ...x means the x coordinate of the parent, i.e. (..).x */
    dx = (/mouse.x + random(6)-3 - ...x)/5;
    dy = (/mouse.y + random(6)-3 - ...y)/5;
    gotoFrame(int(dx*dx + dy*dy));

  "));

  $cell-&gt;nextFrame();
  $cell-&gt;add(new SWFAction("

    gotoFrame(0);
    play();

  "));

  $cell-&gt;nextFrame();


  /* finally, add a bunch of the cells to the movie */

  for($x=0; $x<12; ++$x)
  {
    for($y=0; $y<8; ++$y)
    {
      $i = $m-&gt;add($cell);
      $i-&gt;moveTo(100*$x+50, 100*$y+50);
    }
  }

  $m-&gt;nextFrame();

  $m-&gt;add(new SWFAction("

    gotoFrame(1);
    play();

  "));

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
    <para>
     Same as above, but with nice colored balls...
     <example>
      <title><function>swfaction</function> example</title>
      <programlisting role="php">
&lt;?php

  $m = new SWFMovie();
  $m-&gt;setDimension(11000, 8000);
  $m-&gt;setBackground(0x00, 0x00, 0x00);

  $m-&gt;add(new SWFAction("

this.quality = 0;
/frames.visible = 0;
startDrag('/mouse', 1);

  "));

  // mouse tracking sprite
  $t = new SWFSprite();
  $i = $m-&gt;add($t);
  $i-&gt;setName('mouse');

  $g = new SWFGradient();
  $g-&gt;addEntry(0, 0xff, 0xff, 0xff, 0xff);
  $g-&gt;addEntry(0.1, 0xff, 0xff, 0xff, 0xff);
  $g-&gt;addEntry(0.5, 0xff, 0xff, 0xff, 0x5f);
  $g-&gt;addEntry(1.0, 0xff, 0xff, 0xff, 0);

  // gradient shape thing
  $s = new SWFShape();
  $f = $s-&gt;addFill($g, SWFFILL_RADIAL_GRADIENT);
  $f-&gt;scaleTo(0.03);
  $s-&gt;setRightFill($f);
  $s-&gt;movePenTo(-600, -600);
  $s-&gt;drawLine(1200, 0);
  $s-&gt;drawLine(0, 1200);
  $s-&gt;drawLine(-1200, 0);
  $s-&gt;drawLine(0, -1200);

  // need to make this a sprite so we can multColor it
  $p = new SWFSprite();
  $p-&gt;add($s);
  $p-&gt;nextFrame();

  // put the shape in here, each frame a different color
  $q = new SWFSprite();
  $q-&gt;add(new SWFAction("gotoFrame(random(7)+1); stop();"));
  $i = $q-&gt;add($p);

  $i-&gt;multColor(1.0, 1.0, 1.0);
  $q-&gt;nextFrame();
  $i-&gt;multColor(1.0, 0.5, 0.5);
  $q-&gt;nextFrame();
  $i-&gt;multColor(1.0, 0.75, 0.5);
  $q-&gt;nextFrame();
  $i-&gt;multColor(1.0, 1.0, 0.5);
  $q-&gt;nextFrame();
  $i-&gt;multColor(0.5, 1.0, 0.5);
  $q-&gt;nextFrame();
  $i-&gt;multColor(0.5, 0.5, 1.0);
  $q-&gt;nextFrame();
  $i-&gt;multColor(1.0, 0.5, 1.0);
  $q-&gt;nextFrame();

  // finally, this one contains the action code
  $p = new SWFSprite();
  $i = $p-&gt;add($q);
  $i-&gt;setName('frames');
  $p-&gt;add(new SWFAction("

dx = (/:mousex-/:lastx)/3 + random(10)-5;
dy = (/:mousey-/:lasty)/3;
x = /:mousex;
y = /:mousey;
alpha = 100;

  "));
  $p-&gt;nextFrame();

  $p-&gt;add(new SWFAction("

this.x = x;
this.y = y;
this.alpha = alpha;
x += dx;
y += dy;
dy += 3;
alpha -= 8;

  "));
  $p-&gt;nextFrame();

  $p-&gt;add(new SWFAction("prevFrame(); play();"));
  $p-&gt;nextFrame();

  $i = $m-&gt;add($p);
  $i-&gt;setName('frames');
  $m-&gt;nextFrame();

  $m-&gt;add(new SWFAction("

lastx = mousex;
lasty = mousey;
mousex = /mouse.x;
mousey = /mouse.y;

++num;

if(num == 11)
  num = 1;

removeClip('char' & num);
duplicateClip(/frames, 'char' & num, num);

  "));

  $m-&gt;nextFrame();
  $m-&gt;add(new SWFAction("prevFrame(); play();"));

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();
?&gt;
      </programlisting>
     </example>
    </para>
    <para>
     This simple example will handles keyboard actions.
     (You'll probably have to click in the window to give it focus.
     And you'll probably have to leave your mouse in the frame, too.
     If you know how to give buttons focus programatically, feel free
     to share, won't you?) 
     <example>
      <title><function>swfaction</function> example</title>
      <programlisting role="php">
&lt;?php

  /* sprite has one letter per frame */

  $p = new SWFSprite();
  $p-&gt;add(new SWFAction("stop();"));

  $chars = "abcdefghijklmnopqrstuvwxyz".
           "ABCDEFGHIJKLMNOPQRSTUVWXYZ".
           "1234567890!@#$%^&*()_+-=/[]{}|;:,.<>?`~";

  $f = new SWFFont("_sans");

  for($n=0; $nremove($i);
    $t = new SWFTextField();
    $t-&gt;setFont($f);
    $t-&gt;setHeight(240);
    $t-&gt;setBounds(600,240);
    $t-&gt;align(SWFTEXTFIELD_ALIGN_CENTER);
    $t-&gt;addString($c);
    $i = $p-&gt;add($t);
    $p-&gt;labelFrame($c);
    $p-&gt;nextFrame();
  }


  /* hit region for button - the entire frame */

  $s = new SWFShape();
  $s-&gt;setFillStyle0($s-&gt;addSolidFill(0, 0, 0, 0));
  $s-&gt;drawLine(600, 0);
  $s-&gt;drawLine(0, 400);
  $s-&gt;drawLine(-600, 0);
  $s-&gt;drawLine(0, -400);


  /* button checks for pressed key, sends sprite to the right frame */

  $b = new SWFButton();
  $b-&gt;addShape($s, SWFBUTTON_HIT);

  for($n=0; $naddAction(new SWFAction("

setTarget('/char');
gotoFrame('$c');

    "), SWFBUTTON_KEYPRESS($c));
  }

  $m = new SWFMovie();
  $m-&gt;setDimension(600,400);
  $i = $m-&gt;add($p);
  $i-&gt;setName('char');
  $i-&gt;moveTo(0,80);

  $m-&gt;add($b);

  header('Content-type: application/x-shockwave-flash');
  $m-&gt;output();

?&gt;
      </programlisting>
     </example>
    </para>        
   </refsect1>
  </refentry>
 </reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->

Reply via email to