Have you ever imagined dynamically generating flash animation on a website? This article will help you step into the exciting era of php+flash.
1. Required software
SWF support library: http://reality.sgi.com/grafica/flash/dist.99.linux.tar.Z. There are documents in this package. You can use c to use it.
And of course php4, which can be obtained from http://www.php.net.
2. Installation
1. libswf.a installation
#cp dist.99.linux.tar.Z /usr/local
#tar xvzf dist.99.linux.tar.Z
#cd dist
#make
You will see two files, image.swf and test.swf, generated by the example c program. You can put them in the browser to see the results. If it comes out, you're halfway done. You still need to do something, add in /etc/profile:
SWFBINPATH=/usr/local/dist/bin
export SWFBINPATH
SWFFONTPATH=/usr/local/dist/fonts
export SWFFONTPATH
2. Compile php4
Compile and add: --with-swf=/usr/local/dist;
When compiling, the author found that swf.h could not be found and used #cp /usr/ local/dist/swf.h /php/src/directory/ext/swf to solve the problem. After installation, make the following script (example in the php document). Please note that the swf directory in the current directory must be writable, otherwise not only Apache will error and you won't find anything.
After execution, use the browser to call the test.swf file. You will definitely be surprised by the power of php and experience the perfect feeling of programming and artistic design! There are two programs in /usr/local/dist/bin. imgtofi is used to convert rgb, gif, jpg to the graphics format supported by libswf.a. pstoff is used to convert ps fonts into fonts available in libswf.a. I have converted them. English fonts can be used in the program, but the conversion to Chinese fonts has not been successful. Regarding the PHP function description of SWF, please go to php.net to find the latest manual.