<HTML ><HEAD ><TITLE >SWFMorph</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="Ming functions for Flash" HREF="ref.ming.html"><LINK REL="PREVIOUS" TITLE="SWFMorph->getshape2" HREF="function.swfmorph.getshape2.html"><LINK REL="NEXT" TITLE="SWFMovie->add" HREF="function.swfmovie.add.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="refentry" 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.swfmorph.getshape2.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.swfmovie.add.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><H1 ><A NAME="function.swfmorph" ></A >SWFMorph</H1 ><DIV CLASS="refnamediv" ><A NAME="AEN53984" ></A ><P > (PHP 4 >= 4.0.5)</P >SWFMorph -- Creates a new SWFMorph object.</DIV ><DIV CLASS="refsect1" ><A NAME="AEN53987" ></A ><H2 >Description</H2 >new <B CLASS="methodname" >swfmorph</B > ( void)<BR ></BR ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Warning</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P >This function is <SPAN CLASS="emphasis" ><I CLASS="emphasis" >EXPERIMENTAL</I ></SPAN >. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.</P ></TD ></TR ></TABLE ></DIV ><P > <B CLASS="function" >swfmorph()</B > creates a new SWFMorph object. </P ><P > Also called a "shape tween". This thing lets you make those tacky twisting things that make your computer choke. Oh, joy! </P ><P > 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.) </P ><P > SWFMorph has the following methods : <B CLASS="function" >swfmorph->getshape1()</B > and <B CLASS="function" >swfmorph->getshape1()</B >. </P ><P > This simple example will morph a big red square into a smaller blue black-bordered square. <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN54004" ></A ><P ><B >Example 1. <B CLASS="function" >swfmorph()</B > example</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="php" ><?php $p = new SWFMorph(); $s = $p->getShape1(); $s->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->setLeftFill($s->addFill(0xff, 0, 0)); $s->movePenTo(-1000,-1000); $s->drawLine(2000,0); $s->drawLine(0,2000); $s->drawLine(-2000,0); $s->drawLine(0,-2000); $s = $p->getShape2(); $s->setLine(60,0,0,0); $s->setLeftFill($s->addFill(0, 0, 0xff)); $s->movePenTo(0,-1000); $s->drawLine(1000,1000); $s->drawLine(-1000,1000); $s->drawLine(-1000,-1000); $s->drawLine(1000,-1000); $m = new SWFMovie(); $m->setDimension(3000,2000); $m->setBackground(0xff, 0xff, 0xff); $i = $m->add($p); $i->moveTo(1500,1000); for($r=0.0; $r<=1.0; $r+=0.1) { $i->setRatio($r); $m->nextFrame(); } header('Content-type: application/x-shockwave-flash'); $m->output(); ?></PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></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.swfmorph.getshape2.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.swfmovie.add.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >SWFMorph->getshape2</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="ref.ming.html" ACCESSKEY="U" >Up</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >SWFMovie->add</TD ></TR ></TABLE ></DIV ></BODY ></HTML >