Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > main > by-pkgid > 0afeee9cca140e167a996902b9a677c5 > files > 3144

php-manual-en-4.3.0-2mdk.noarch.rpm

<HTML
><HEAD
><TITLE
>Shockwave Flash functions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="PHP Manual"
HREF="index.html"><LINK
REL="UP"
TITLE="Function Reference"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="shmop_write"
HREF="function.shmop-write.html"><LINK
REL="NEXT"
TITLE="swf_actiongeturl"
HREF="function.swf-actiongeturl.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=ISO-8859-1"></HEAD
><BODY
CLASS="reference"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP Manual</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.shmop-write.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.swf-actiongeturl.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.swf"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>XCV. Shockwave Flash functions</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN85030"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="swf.intro"
></A
>Introduction</H1
><P
>&#13;     PHP offers the ability to create Shockwave Flash files via Paul
     Haeberli's libswf module.
    </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Note: </B
>
      SWF support was added in PHP 4 RC2.
     </P
><P
>&#13;      The libswf does not have support for Windows. The development of
      that library has been stopped, and the source is not available
      to port it to another systems.
     </P
><P
>&#13;      For up to date SWF support take a look at the
      <A
HREF="ref.ming.html"
>MING</A
> functions.
     </P
></BLOCKQUOTE
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="swf.requirements"
></A
>Requirements</H1
><P
>&#13;     You need the libswf library to compile PHP with support for this
     extension. You can download libswf at <A
HREF="ftp://ftp.sgi.com/sgi/graphics/grafica/flash"
TARGET="_top"
>ftp://ftp.sgi.com/sgi/graphics/grafica/flash</A
>.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="swf.installation"
></A
>Installation</H1
><P
>&#13;  Once you have libswf all you need to do is to configure <TT
CLASS="option"
>--with-swf[=DIR]</TT
> where DIR is a location
  containing the directories include and lib. The include directory
  has to contain the <TT
CLASS="filename"
>swf.h</TT
> file and the lib directory
  has to contain the <TT
CLASS="filename"
>libswf.a</TT
> file. If you unpack the
  libswf distribution the two files will be in one directory. Consequently
  you will have to copy the files to the proper location manually.
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="swf.configuration"
></A
>Runtime Configuration</H1
><P
>This extension has no configuration directives defined in <TT
CLASS="filename"
>php.ini</TT
>.</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="swf.resources"
></A
>Resource Types</H1
><P
>This extension has no resource types defined.</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="swf.constants"
></A
>Predefined Constants</H1
><P
>&#13;The constants below are defined by this extension, and
will only be available when the extension has either
been compiled into PHP or dynamically loaded at runtime.
</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><TT
CLASS="constant"
><B
>MOD_COLOR</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>MOD_MATRIX</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>TYPE_PUSHBUTTON</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>TYPE_MENUBUTTON</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>BSHitTest</B
></TT
> 
    (<A
HREF="language.types.float.html"
>float</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>BSDown</B
></TT
> 
    (<A
HREF="language.types.float.html"
>float</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>BSOver</B
></TT
> 
    (<A
HREF="language.types.float.html"
>float</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>BSUp</B
></TT
> 
    (<A
HREF="language.types.float.html"
>float</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>OverDowntoIdle</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>IdletoOverDown</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>OutDowntoIdle</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>OutDowntoOverDown</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>OverDowntoOutDown</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>OverUptoOverDown</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>OverUptoIdle</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>IdletoOverUp</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>ButtonEnter</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>ButtonExit</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>MenuEnter</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>MenuExit</B
></TT
> 
    (<A
HREF="language.types.integer.html"
>integer</A
>)</DT
><DD
><P
>&#13;     
    </P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="swf.examples"
></A
>Examples</H1
><P
>&#13;     Once you've successfully installed PHP with Shockwave Flash
     support you can then go about creating Shockwave files from PHP.
     You would be surprised at what you can do, take the following
     code:
     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN85183"
></A
><P
><B
>Example 1. SWF example</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="php"
>&#60;?php
swf_openfile ("test.swf", 256, 256, 30, 1, 1, 1);
swf_ortho2 (-100, 100, -100, 100);
swf_defineline (1, -70, 0, 70, 0, .2);
swf_definerect (4, 60, -10, 70, 0, 0);
swf_definerect (5, -60, 0, -70, 10, 0);
swf_addcolor (0, 0, 0, 0);

swf_definefont (10, "Mod");
swf_fontsize (5);
swf_fontslant (10);
swf_definetext (11, "This be Flash wit PHP!", 1);

swf_pushmatrix ();
swf_translate (-50, 80, 0);
swf_placeobject (11, 60);
swf_popmatrix ();

for ($i = 0; $i &#60; 30; $i++) {
    $p = $i/(30-1);
    swf_pushmatrix ();
    swf_scale (1-($p*.9), 1, 1);
    swf_rotate (60*$p,  'z');
    swf_translate (20+20*$p, $p/1.5, 0);
    swf_rotate (270*$p,  'z');
    swf_addcolor ($p, 0, $p/1.2, -$p);
    swf_placeobject (1, 50);
    swf_placeobject (4, 50);
    swf_placeobject (5, 50);
    swf_popmatrix ();
    swf_showframe ();
}

for ($i = 0; $i &#60; 30; $i++) {
    swf_removeobject (50);
    if (($i%4) == 0) {
        swf_showframe ();
    }
}

swf_startdoaction ();
swf_actionstop ();
swf_enddoaction ();

swf_closefile ();
?&#62;</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
><A
HREF="function.swf-actiongeturl.html"
>swf_actiongeturl</A
>&nbsp;--&nbsp;Get a URL from a Shockwave Flash movie</DT
><DT
><A
HREF="function.swf-actiongotoframe.html"
>swf_actiongotoframe</A
>&nbsp;--&nbsp;Play a frame and then stop</DT
><DT
><A
HREF="function.swf-actiongotolabel.html"
>swf_actiongotolabel</A
>&nbsp;--&nbsp;
     Display a frame with the specified label
    </DT
><DT
><A
HREF="function.swf-actionnextframe.html"
>swf_actionnextframe</A
>&nbsp;--&nbsp;Go foward one frame</DT
><DT
><A
HREF="function.swf-actionplay.html"
>swf_actionplay</A
>&nbsp;--&nbsp;
     Start playing the flash movie from the current frame
    </DT
><DT
><A
HREF="function.swf-actionprevframe.html"
>swf_actionprevframe</A
>&nbsp;--&nbsp;Go backwards one frame</DT
><DT
><A
HREF="function.swf-actionsettarget.html"
>swf_actionsettarget</A
>&nbsp;--&nbsp;Set the context for actions</DT
><DT
><A
HREF="function.swf-actionstop.html"
>swf_actionstop</A
>&nbsp;--&nbsp;
     Stop playing the flash movie at the current frame
    </DT
><DT
><A
HREF="function.swf-actiontogglequality.html"
>swf_actiontogglequality</A
>&nbsp;--&nbsp;
     Toggle between low and high quality
    </DT
><DT
><A
HREF="function.swf-actionwaitforframe.html"
>swf_actionwaitforframe</A
>&nbsp;--&nbsp;
     Skip actions if a frame has not been loaded
    </DT
><DT
><A
HREF="function.swf-addbuttonrecord.html"
>swf_addbuttonrecord</A
>&nbsp;--&nbsp;
     Controls location, appearance and active area of the current button
    </DT
><DT
><A
HREF="function.swf-addcolor.html"
>swf_addcolor</A
>&nbsp;--&nbsp;
     Set the global add color to the rgba value specified
    </DT
><DT
><A
HREF="function.swf-closefile.html"
>swf_closefile</A
>&nbsp;--&nbsp;Close the current Shockwave Flash file</DT
><DT
><A
HREF="function.swf-definebitmap.html"
>swf_definebitmap</A
>&nbsp;--&nbsp;Define a bitmap</DT
><DT
><A
HREF="function.swf-definefont.html"
>swf_definefont</A
>&nbsp;--&nbsp;
     Defines a font
    </DT
><DT
><A
HREF="function.swf-defineline.html"
>swf_defineline</A
>&nbsp;--&nbsp;Define a line</DT
><DT
><A
HREF="function.swf-definepoly.html"
>swf_definepoly</A
>&nbsp;--&nbsp;
     Define a polygon
    </DT
><DT
><A
HREF="function.swf-definerect.html"
>swf_definerect</A
>&nbsp;--&nbsp;Define a rectangle</DT
><DT
><A
HREF="function.swf-definetext.html"
>swf_definetext</A
>&nbsp;--&nbsp;Define a text string</DT
><DT
><A
HREF="function.swf-endbutton.html"
>swf_endbutton</A
>&nbsp;--&nbsp;
     End the definition of the current button
    </DT
><DT
><A
HREF="function.swf-enddoaction.html"
>swf_enddoaction</A
>&nbsp;--&nbsp;End the current action</DT
><DT
><A
HREF="function.swf-endshape.html"
>swf_endshape</A
>&nbsp;--&nbsp;
     Completes the definition of the current shape
    </DT
><DT
><A
HREF="function.swf-endsymbol.html"
>swf_endsymbol</A
>&nbsp;--&nbsp;End the definition of a symbol</DT
><DT
><A
HREF="function.swf-fontsize.html"
>swf_fontsize</A
>&nbsp;--&nbsp;Change the font size</DT
><DT
><A
HREF="function.swf-fontslant.html"
>swf_fontslant</A
>&nbsp;--&nbsp;Set the font slant</DT
><DT
><A
HREF="function.swf-fonttracking.html"
>swf_fonttracking</A
>&nbsp;--&nbsp;Set the current font tracking</DT
><DT
><A
HREF="function.swf-getbitmapinfo.html"
>swf_getbitmapinfo</A
>&nbsp;--&nbsp;Get information about a bitmap</DT
><DT
><A
HREF="function.swf-getfontinfo.html"
>swf_getfontinfo</A
>&nbsp;--&nbsp;
     The height in pixels of a capital A and a lowercase x
    </DT
><DT
><A
HREF="function.swf-getframe.html"
>swf_getframe</A
>&nbsp;--&nbsp;Get the frame number of the current frame</DT
><DT
><A
HREF="function.swf-labelframe.html"
>swf_labelframe</A
>&nbsp;--&nbsp;Label the current frame</DT
><DT
><A
HREF="function.swf-lookat.html"
>swf_lookat</A
>&nbsp;--&nbsp;Define a viewing transformation</DT
><DT
><A
HREF="function.swf-modifyobject.html"
>swf_modifyobject</A
>&nbsp;--&nbsp;Modify an object</DT
><DT
><A
HREF="function.swf-mulcolor.html"
>swf_mulcolor</A
>&nbsp;--&nbsp;
     Sets the global multiply color to the rgba value specified
    </DT
><DT
><A
HREF="function.swf-nextid.html"
>swf_nextid</A
>&nbsp;--&nbsp;Returns the next free object id</DT
><DT
><A
HREF="function.swf-oncondition.html"
>swf_oncondition</A
>&nbsp;--&nbsp;
     Describe a transition used to trigger an action list
    </DT
><DT
><A
HREF="function.swf-openfile.html"
>swf_openfile</A
>&nbsp;--&nbsp;Open a new Shockwave Flash file</DT
><DT
><A
HREF="function.swf-ortho2.html"
>swf_ortho2</A
>&nbsp;--&nbsp;
     Defines 2D orthographic mapping of user coordinates onto the
     current viewport
    </DT
><DT
><A
HREF="function.swf-ortho.html"
>swf_ortho</A
>&nbsp;--&nbsp;
     Defines an orthographic mapping of user coordinates onto the
     current viewport
    </DT
><DT
><A
HREF="function.swf-perspective.html"
>swf_perspective</A
>&nbsp;--&nbsp;
     Define a perspective projection transformation
    </DT
><DT
><A
HREF="function.swf-placeobject.html"
>swf_placeobject</A
>&nbsp;--&nbsp;Place an object onto the screen</DT
><DT
><A
HREF="function.swf-polarview.html"
>swf_polarview</A
>&nbsp;--&nbsp;
     Define the viewer's position with polar coordinates
    </DT
><DT
><A
HREF="function.swf-popmatrix.html"
>swf_popmatrix</A
>&nbsp;--&nbsp;
     Restore a previous transformation matrix
    </DT
><DT
><A
HREF="function.swf-posround.html"
>swf_posround</A
>&nbsp;--&nbsp;
     Enables or Disables the rounding of the translation when objects
     are placed or moved
    </DT
><DT
><A
HREF="function.swf-pushmatrix.html"
>swf_pushmatrix</A
>&nbsp;--&nbsp;
     Push the current transformation matrix back unto the stack
    </DT
><DT
><A
HREF="function.swf-removeobject.html"
>swf_removeobject</A
>&nbsp;--&nbsp;Remove an object</DT
><DT
><A
HREF="function.swf-rotate.html"
>swf_rotate</A
>&nbsp;--&nbsp;Rotate the current transformation</DT
><DT
><A
HREF="function.swf-scale.html"
>swf_scale</A
>&nbsp;--&nbsp;Scale the current transformation</DT
><DT
><A
HREF="function.swf-setfont.html"
>swf_setfont</A
>&nbsp;--&nbsp;Change the current font</DT
><DT
><A
HREF="function.swf-setframe.html"
>swf_setframe</A
>&nbsp;--&nbsp;Switch to a specified frame</DT
><DT
><A
HREF="function.swf-shapearc.html"
>swf_shapearc</A
>&nbsp;--&nbsp;Draw a circular arc</DT
><DT
><A
HREF="function.swf-shapecurveto3.html"
>swf_shapecurveto3</A
>&nbsp;--&nbsp;Draw a cubic bezier curve</DT
><DT
><A
HREF="function.swf-shapecurveto.html"
>swf_shapecurveto</A
>&nbsp;--&nbsp;
     Draw a quadratic bezier curve between two points
    </DT
><DT
><A
HREF="function.swf-shapefillbitmapclip.html"
>swf_shapefillbitmapclip</A
>&nbsp;--&nbsp;
     Set current fill mode to clipped bitmap
    </DT
><DT
><A
HREF="function.swf-shapefillbitmaptile.html"
>swf_shapefillbitmaptile</A
>&nbsp;--&nbsp;
     Set current fill mode to tiled bitmap
    </DT
><DT
><A
HREF="function.swf-shapefilloff.html"
>swf_shapefilloff</A
>&nbsp;--&nbsp;Turns off filling</DT
><DT
><A
HREF="function.swf-shapefillsolid.html"
>swf_shapefillsolid</A
>&nbsp;--&nbsp;
     Set the current fill style to the specified color
    </DT
><DT
><A
HREF="function.swf-shapelinesolid.html"
>swf_shapelinesolid</A
>&nbsp;--&nbsp;Set the current line style</DT
><DT
><A
HREF="function.swf-shapelineto.html"
>swf_shapelineto</A
>&nbsp;--&nbsp;Draw a line</DT
><DT
><A
HREF="function.swf-shapemoveto.html"
>swf_shapemoveto</A
>&nbsp;--&nbsp;Move the current position</DT
><DT
><A
HREF="function.swf-showframe.html"
>swf_showframe</A
>&nbsp;--&nbsp;Display the current frame</DT
><DT
><A
HREF="function.swf-startbutton.html"
>swf_startbutton</A
>&nbsp;--&nbsp;Start the definition of a button</DT
><DT
><A
HREF="function.swf-startdoaction.html"
>swf_startdoaction</A
>&nbsp;--&nbsp;
     Start a description of an action list for the current frame
    </DT
><DT
><A
HREF="function.swf-startshape.html"
>swf_startshape</A
>&nbsp;--&nbsp;Start a complex shape</DT
><DT
><A
HREF="function.swf-startsymbol.html"
>swf_startsymbol</A
>&nbsp;--&nbsp;Define a symbol</DT
><DT
><A
HREF="function.swf-textwidth.html"
>swf_textwidth</A
>&nbsp;--&nbsp;Get the width of a string</DT
><DT
><A
HREF="function.swf-translate.html"
>swf_translate</A
>&nbsp;--&nbsp;Translate the current transformations</DT
><DT
><A
HREF="function.swf-viewport.html"
>swf_viewport</A
>&nbsp;--&nbsp;Select an area for future drawing</DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.shmop-write.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.swf-actiongeturl.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>shmop_write</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>swf_actiongeturl</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>