云联天下首页 |  登陆 |  注册 |  密码找回 |  关于我们 | 加入收藏 
首页技术资料图形图像→Shockwave Flash 函数 【字号: 】 【背景色 杏仁黄 秋叶褐 胭脂红 芥末绿 天蓝 雪青 灰 银河白(默认色)

Shockwave Flash 函数

网址来源:http://www.kehui.net发布时间: 2002-01-21 18:12:12
<br>PHP offers the ability to create Shockwave Flash files via Paul Haeberli’s libswf module. You can download libswf at http://reality.sgi.com/grafica/flash/. Once you have libswf all you need to do is to configure --with-swf[=DIR] where DIR is a location containing the directories include and lib. The include directory has to contain the swf.h file and the lib directory has to contain the libswf.a 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.



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: Example 1. SWF example



<?php<br>swf_openfile ("test.swf", 256, 256, 30, 1, 1, 1);<br>swf_ortho2 (-100, 100, -100, 100);<br>swf_defineline (1, -70, 0, 70, 0, .2);<br>swf_definerect (4, 60, -10, 70, 0, 0);<br>swf_definerect (5, -60, 0, -70, 10, 0);<br>swf_addcolor (0, 0, 0, 0);



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



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



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



for ($i = 0; $i < 30; $i++) {<br>    swf_removeobject (50);<br>    if (($i%4) == 0) {<br>  swf_showframe ();<br>    }<br>}



swf_startdoaction ();<br>swf_actionstop ();<br>swf_enddoaction ();



swf_closefile ();<br>?><br>    



<br>It will produce the animation found at the following url.



Note: SWF support was added in PHP 4 RC2.



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.



Table of Contents<br>swf_openfile — Open a new Shockwave Flash file<br>swf_closefile — Close the current Shockwave Flash file<br>swf_labelframe — Label the current frame<br>swf_showframe — Display the current frame<br>swf_setframe — Switch to a specified frame<br>swf_getframe — Get the frame number of the current frame<br>swf_mulcolor — Sets the global multiply color to the rgba value specified <br>swf_addcolor — Set the global add color to the rgba value specified <br>swf_placeobject — Place an object onto the screen<br>swf_modifyobject — Modify an object<br>swf_removeobject — Remove an object<br>swf_nextid — Returns the next free object id<br>swf_startdoaction — Start a description of an action list for the current frame <br>swf_actiongotoframe — Play a frame and then stop<br>swf_actiongeturl — Get a URL from a Shockwave Flash movie<br>swf_actionnextframe — Go foward one frame<br>swf_actionprevframe — Go backwards one frame<br>swf_actionplay — Start playing the flash movie from the current frame <br>swf_actionstop — Stop playing the flash movie at the current frame <br>swf_actiontogglequality — Toggle between low and high quality <br>swf_actionwaitforframe — Skip actions if a frame has not been loaded <br>swf_actionsettarget — Set the context for actions<br>swf_actiongotolabel — Display a frame with the specified label <br>swf_enddoaction — End the current action<br>swf_defineline — Define a line<br>swf_definerect — Define a rectangle<br>swf_definepoly — Define a polygon <br>swf_startshape — Start a complex shape<br>swf_shapelinesolid — Set the current line style<br>swf_shapefilloff — Turns off filling<br>swf_shapefillsolid — Set the current fill style to the specified color <br>swf_shapefillbitmapclip — Set current fill mode to clipped bitmap <br>swf_shapefillbitmaptile — Set current fill mode to tiled bitmap <br>swf_shapemoveto — Move the current position<br>swf_shapelineto — Draw a line<br>swf_shapecurveto — Draw a quadratic bezier curve between two points <br>swf_shapecurveto3 — Draw a cubic bezier curve<br>swf_shapearc — Draw a circular arc<br>swf_endshape — Completes the definition of the current shape <br>swf_definefont — Defines a font <br>swf_setfont — Change the current font<br>swf_fontsize — Change the font size<br>swf_fontslant — Set the font slant<br>swf_fonttracking — Set the current font tracking<br>swf_getfontinfo — The height in pixels of a capital A and a lowercase x <br>swf_definetext — Define a text string<br>swf_textwidth — Get the width of a string<br>swf_definebitmap — Define a bitmap<br>swf_getbitmapinfo — Get information about a bitmap<br>swf_startsymbol — Define a symbol<br>swf_endsymbol — End the definition of a symbol<br>swf_startbutton — Start the definition of a button<br>swf_addbuttonrecord — Controls location, appearance and active area of the current button <br>swf_oncondition — Describe a transition used to trigger an action list <br>swf_endbutton — End the definition of the current button <br>swf_viewport — Select an area for future drawing<br>swf_ortho — Defines an orthographic mapping of user coordinates onto the current viewport <br>swf_ortho2 — Defines 2D orthographic mapping of user coordinates onto the current viewport <br>swf_perspective — Define a perspective projection transformation <br>swf_polarview — Define the viewer’s position with polar coordinates <br>swf_lookat — Define a viewing transformation<br>swf_pushmatrix — Push the current transformation matrix back unto the stack <br>swf_popmatrix — Restore a previous transformation matrix <br>swf_scale — Scale the current transformation<br>swf_translate — Translate the current transformations<br>swf_rotate — Rotate the current transformation<br>swf_posround — Enables or Disables the rounding of the translation when objects are placed or moved

kehui 

相关新闻
v 侃侃网页图形制作的各个软件。 2002-01-21 18:12:12
v 介绍一种最常用的看图软件ACD SEE。。。可能大都知道:)不要骂我啊~~ 2002-01-21 18:12:12
v 中文Photoshop5.0特效字系列--球面字 2002-01-21 18:12:12
v PhotoShop 6.0滤镜详解 2002-01-21 18:12:12
v 如何用FIREWORKS做简单的GIF动画 2002-01-21 18:12:12
v 透明gif档的做法如下: (网页上只支持gif89a格式的透明档) 2002-01-21 18:12:12
v Flash4运算符号功能函数介绍 2002-01-21 18:28:21
v 初窥PhotoShop6.0 2002-01-21 18:29:00
v “压图高手”:JPEG Optimizer V3.0 2002-01-21 18:29:00
v 用Photoshop制作透明图片和在Flash中实现3D效果 2002-01-21 18:29:00
  最新新闻
智慧家居
智慧家居颠覆传统智能家居
智慧云谷让智能家居变成有智慧的
智慧云谷引领智慧家居新生活
科技改变生活 智慧云谷智慧家居系
智慧家居领航者,智慧云谷助你玩
智能家居如何赢得市场美誉度?
智慧云谷智慧家居:创业者有无限
WiFi智能家居你还在用?这样的智
互联网+助推智能家居产业
智慧云谷为您打造真正的智能家居
智能家居产业需要的不是单品,而
新家如何选择开关?智慧云谷iWis
智能传感器-世界首款“智”为你的
智慧云谷开关智能安防智能空气质
智能开关品牌,如何选择智能开关
秋季干燥,智慧家居温湿度传感器
传感器助力智慧家居 感知爱家
iWiscloud智能触摸开关缔造家居装

  最新帖子
 ※室内空气污染的危害及  [sensor]
 ※超声波风速传感器在生  [sensor]
 ※这么冷清  [gabc111]
 ※手机APP操作有问题  [ssy11407]
 ※智慧云谷智慧家居将在  [cici]
 ※上传下载  [cici]
 ※下载智慧家居  [apple2008]
 ※秋季干燥,智慧家居温  [apple2008]
 ※智慧家居紧扣热点 安全  [apple2008]
 ※办公大楼如何智慧化管  [apple2008]
 ※智慧云谷工业自控的优  [apple2008]
 ※传感器助力智慧家居 感  [apple2008]
 ※智能开关品牌,如何选  [apple2008]
 ※智慧云谷开关智能安防  [apple2008]
 ※没有专业人员,如何安  [apple2008]
 ※烟台智慧云谷董事长任  [apple2008]
 ※互联网+助推智能家居产  [apple2008]
 ※WiFi智能家居你还在用  [apple2008]
 ※智慧云谷智慧家居:创  [apple2008]
 ※智能家居如何赢得市场  [apple2008]
钯碳回收 硝酸银回收 银浆回收 银焊条回收 回收银浆 氯化钯回收 氯化钯回收 氧化钯回收 回收硝酸钯 钯水回收价格 海绵钯回收 钯炭回收价格 回收镀金板 深圳钯碳回收 镇江氯化钯回收 杭州钯浆回收 银浆回收多少钱 回收钯碳公司 硝酸银的价格 那里有回收金 氯化钯回收价格 江苏擦银布回收 硝酸银价格 德州钯粉回收 银铜回收 回收钯粉 回收铂碳催化剂 佛山钯碳回收 金盐回收价格 海绵钯回收 钯碳高价回收 钯回收价格 钯炭回收