1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851
|
<?xml version="1.0" encoding="utf-8"?>
<reference id="ref.swf">
<title>Shockwave Flash functions</title>
<titleabbrev>SWF</titleabbrev>
<partintro>
<simpara>
PHP offers the ability to create Shockwave Flash files via Paul
Haeberli's libswf module. You can download libswf at <ulink
url="&url.swf;">&url.swf;</ulink>. Once you have libswf all you
need to do is to configure <option
role="configure">--with-swf[=DIR]</option> 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.
</simpara>
<para>
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>
<title>SWF example</title>
<programlisting role="php">
<?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 < 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 < 30; $i++) {
swf_removeobject (50);
if (($i%4) == 0) {
swf_showframe ();
}
}
swf_startdoaction ();
swf_actionstop ();
swf_enddoaction ();
swf_closefile ();
?>
</programlisting>
</example>
It will produce the animation found at the following <ulink
url="&url.swf.test;">url</ulink>.
</para>
<note>
<para>
SWF support was added in PHP 4 RC2.
</para>
<para>
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.
</para>
</note>
</partintro>
<refentry id="function.swf-openfile">
<refnamediv>
<refname>swf_openfile</refname>
<refpurpose>Open a new Shockwave Flash file</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_openfile</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam><type>float</type><parameter>width</parameter></methodparam>
<methodparam><type>float</type><parameter>height</parameter></methodparam>
<methodparam><type>float</type><parameter>framerate</parameter></methodparam>
<methodparam><type>float</type><parameter>r</parameter></methodparam>
<methodparam><type>float</type><parameter>g</parameter></methodparam>
<methodparam><type>float</type><parameter>b</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_openfile</function> function opens a new file
named <parameter>filename</parameter> with a width of
<parameter>width</parameter> and a height of
<parameter>height</parameter> a frame rate of
<parameter>framerate</parameter> and background with a red color
of <parameter>r</parameter> a green color of
<parameter>g</parameter> and a blue color of
<parameter>b</parameter>.
</para>
<para>
The <function>swf_openfile</function> must be the first function
you call, otherwise your script will cause a segfault. If you
want to send your output to the screen make the filename:
"php://stdout" (support for this is in 4.0.1 and up).
</para>
</refsect1>
</refentry>
<refentry id="function.swf-closefile">
<refnamediv>
<refname>swf_closefile</refname>
<refpurpose>Close the current Shockwave Flash file</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_closefile</methodname>
<methodparam choice="opt"><type>int</type><parameter>
return_file
</parameter></methodparam>
</methodsynopsis>
<para>
Close a file that was opened by the
<function>swf_openfile</function> function. If the
<parameter>return_file</parameter> parameter is set then the contents
of the SWF file are returned from the function.
</para>
<para>
<example>
<title>
Creating a simple flash file based on user input and outputting it
and saving it in a database
</title>
<programlisting role="php">
<?php
// The $text variable is submitted by the
// user
// Global variables for database
// access (used in the swf_savedata() function)
$DBHOST = "localhost";
$DBUSER = "sterling";
$DBPASS = "secret";
swf_openfile ("php://stdout", 256, 256, 30, 1, 1, 1);
swf_definefont (10, "Ligon-Bold");
swf_fontsize (12);
swf_fontslant (10);
swf_definetext (11, $text, 1);
swf_pushmatrix ();
swf_translate (-50, 80, 0);
swf_placeobject (11, 60);
swf_popmatrix ();
swf_showframe ();
swf_startdoaction ();
swf_actionstop ();
swf_enddoaction ();
$data = swf_closefile (1);
$data ?
swf_savedata ($data) :
die ("Error could not save SWF file");
// void swf_savedata (string data)
// Save the generated file a database
// for later retrieval
function swf_savedata ($data)
{
global $DBHOST,
$DBUSER,
$DBPASS;
$dbh = @mysql_connect ($DBHOST, $DBUSER, $DBPASS);
if (!$dbh) {
die (sprintf ("Error [%d]: %s",
mysql_errno (), mysql_error ()));
}
$stmt = "INSERT INTO swf_files (file) VALUES ('$data')";
$sth = @mysql_query ($stmt, $dbh);
if (!$sth) {
die (sprintf ("Error [%d]: %s",
mysql_errno (), mysql_error ()));
}
@mysql_free_result ($sth);
@mysql_close ($dbh);
}
>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.swf-labelframe">
<refnamediv>
<refname>swf_labelframe</refname>
<refpurpose>Label the current frame</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_labelframe</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
</methodsynopsis>
<para>
Label the current frame with the name given by the
<parameter>name</parameter> parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-showframe">
<refnamediv>
<refname>swf_showframe</refname>
<refpurpose>Display the current frame</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_showframe</methodname>
<void/>
</methodsynopsis>
<para>
The swf_showframe function will output the current frame.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-setframe">
<refnamediv>
<refname>swf_setframe</refname>
<refpurpose>Switch to a specified frame</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_setframe</methodname>
<methodparam><type>int</type><parameter>framenumber</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_setframe</function> changes the active frame to
the frame specified by <parameter>framenumber</parameter>.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-getframe">
<refnamediv>
<refname>swf_getframe</refname>
<refpurpose>Get the frame number of the current frame</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>swf_getframe</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_getframe</function> function gets the number of
the current frame.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-mulcolor">
<refnamediv>
<refname>swf_mulcolor</refname>
<refpurpose>
Sets the global multiply color to the rgba value specified
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_mulcolor</methodname>
<methodparam><type>float</type><parameter>r</parameter></methodparam>
<methodparam><type>float</type><parameter>g</parameter></methodparam>
<methodparam><type>float</type><parameter>b</parameter></methodparam>
<methodparam><type>float</type><parameter>a</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_mulcolor</function> function sets the global
multiply color to the <parameter>rgba</parameter> color
specified. This color is then used (implicitly) by the
<function>swf_placeobject</function>,
<function>swf_modifyobject</function> and the
<function>swf_addbuttonrecord</function> functions. The color of
the object will be multiplied by the <parameter>rgba</parameter>
values when the object is written to the screen.
</para>
<note>
<para>
The <parameter>rgba</parameter> values can be either positive or
negative.
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.swf-addcolor">
<refnamediv>
<refname>swf_addcolor</refname>
<refpurpose>
Set the global add color to the rgba value specified
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_addcolor</methodname>
<methodparam><type>float</type><parameter>r</parameter></methodparam>
<methodparam><type>float</type><parameter>g</parameter></methodparam>
<methodparam><type>float</type><parameter>b</parameter></methodparam>
<methodparam><type>float</type><parameter>a</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_addcolor</function> function sets the global
add color to the <parameter>rgba</parameter> color specified.
This color is then used (implicitly) by the
<function>swf_placeobject</function>,
<function>swf_modifyobject</function> and the
<function>swf_addbuttonrecord</function> functions. The color of
the object will be add by the <parameter>rgba</parameter> values
when the object is written to the screen.
</para>
<note>
<para>
The <parameter>rgba</parameter> values can be either positive or
negative.
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.swf-placeobject">
<refnamediv>
<refname>swf_placeobject</refname>
<refpurpose>Place an object onto the screen</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_placeobject</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
<methodparam><type>int</type><parameter>depth</parameter></methodparam>
</methodsynopsis>
<para>
Places the object specified by <parameter>objid</parameter> in
the current frame at a depth of <parameter>depth</parameter>.
The <parameter>objid</parameter> parameter and the
<parameter>depth</parameter> must be between 1 and 65535.
</para>
<para>
This uses the current mulcolor (specified by
<function>swf_mulcolor</function>) and the current addcolor
(specified by <function>swf_addcolor</function>) to color the
object and it uses the current matrix to position the object.
</para>
<note>
<para>
Full RGBA colors are supported.
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.swf-modifyobject">
<refnamediv>
<refname>swf_modifyobject</refname>
<refpurpose>Modify an object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_modifyobject</methodname>
<methodparam><type>int</type><parameter>depth</parameter></methodparam>
<methodparam><type>int</type><parameter>how</parameter></methodparam>
</methodsynopsis>
<para>
Updates the position and/or color of the object at the specified
depth, <parameter>depth</parameter>. The parameter
<parameter>how</parameter> determines what is updated.
<parameter>how</parameter> can either be the constant MOD_MATRIX
or MOD_COLOR or it can be a combination of both
(MOD_MATRIX|MOD_COLOR).
</para>
<para>
MOD_COLOR uses the current mulcolor (specified by the function
<function>swf_mulcolor</function>) and addcolor (specified by the
function <function>swf_addcolor</function>) to color the object.
MOD_MATRIX uses the current matrix to position the object.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-removeobject">
<refnamediv>
<refname>swf_removeobject</refname>
<refpurpose>Remove an object</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_removeobject</methodname>
<methodparam><type>int</type><parameter>depth</parameter></methodparam>
</methodsynopsis>
<para>
Removes the object at the depth specified by
<parameter>depth</parameter>.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-nextid">
<refnamediv>
<refname>swf_nextid</refname>
<refpurpose>Returns the next free object id</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>int</type><methodname>swf_nextid</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_nextid</function> function returns the next
available object id.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-startdoaction">
<refnamediv>
<refname>swf_startdoaction</refname>
<refpurpose>
Start a description of an action list for the current frame
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_startdoaction</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_startdoaction</function> function starts the
description of an action list for the current frame. This must
be called before actions are defined for the current frame.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actiongotoframe">
<refnamediv>
<refname>swf_actiongotoframe</refname>
<refpurpose>Play a frame and then stop</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actiongotoframe</methodname>
<methodparam><type>int</type><parameter>framenumber</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_actionGotoFrame</function> function will go to
the frame specified by <parameter>framenumber</parameter>, play
it, and then stop.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actiongeturl">
<refnamediv>
<refname>swf_actiongeturl</refname>
<refpurpose>Get a URL from a Shockwave Flash movie</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actiongeturl</methodname>
<methodparam><type>string</type><parameter>url</parameter></methodparam>
<methodparam><type>string</type><parameter>target</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_actionGetUrl</function> function gets the URL
specified by the parameter <parameter>url</parameter> with the
target <parameter> target</parameter>.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actionnextframe">
<refnamediv>
<refname>swf_actionnextframe</refname>
<refpurpose>Go foward one frame</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actionnextframe</methodname>
<void/>
</methodsynopsis>
<para>
Go foward one frame.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actionprevframe">
<refnamediv>
<refname>swf_actionprevframe</refname>
<refpurpose>Go backwards one frame</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actionprevframe</methodname>
<void/>
</methodsynopsis>
</refsect1>
</refentry>
<refentry id="function.swf-actionplay">
<refnamediv>
<refname>swf_actionplay</refname>
<refpurpose>
Start playing the flash movie from the current frame
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actionplay</methodname>
<void/>
</methodsynopsis>
<para>
Start playing the flash movie from the current frame.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actionstop">
<refnamediv>
<refname>swf_actionstop</refname>
<refpurpose>
Stop playing the flash movie at the current frame
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actionstop</methodname>
<void/>
</methodsynopsis>
<para>
Stop playing the flash movie at the current frame.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actiontogglequality">
<refnamediv>
<refname>swf_actiontogglequality</refname>
<refpurpose>
Toggle between low and high quality
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actiontogglequality</methodname>
<void/>
</methodsynopsis>
<para>
Toggle the flash movie between high and low quality.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actionwaitforframe">
<refnamediv>
<refname>swf_actionwaitforframe</refname>
<refpurpose>
Skip actions if a frame has not been loaded
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actionwaitforframe</methodname>
<methodparam><type>int</type><parameter>framenumber</parameter></methodparam>
<methodparam><type>int</type><parameter>skipcount</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_actionWaitForFrame</function> function will
check to see if the frame, specified by the
<parameter>framenumber</parameter> parameter has been loaded, if
not it will skip the number of actions specified by the
<parameter>skipcount</parameter> parameter. This can be useful
for "Loading..." type animations.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actionsettarget">
<refnamediv>
<refname>swf_actionsettarget</refname>
<refpurpose>Set the context for actions</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actionsettarget</methodname>
<methodparam><type>string</type><parameter>target</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_actionSetTarget</function> function sets the
context for all actions. You can use this to control other flash
movies that are currently playing.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-actiongotolabel">
<refnamediv>
<refname>swf_actiongotolabel</refname>
<refpurpose>
Display a frame with the specified label
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_actiongotolabel</methodname>
<methodparam><type>string</type><parameter>label</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_actionGotoLabel</function> function displays
the frame with the label given by the
<parameter>label</parameter> parameter and then stops.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-enddoaction">
<refnamediv>
<refname>swf_enddoaction</refname>
<refpurpose>End the current action</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_enddoaction</methodname>
<void/>
</methodsynopsis>
<para>
Ends the current action started by the
<function>swf_startdoaction</function> function.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-defineline">
<refnamediv>
<refname>swf_defineline</refname>
<refpurpose>Define a line</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_defineline</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
<methodparam><type>float</type><parameter>x1</parameter></methodparam>
<methodparam><type>float</type><parameter>y1</parameter></methodparam>
<methodparam><type>float</type><parameter>x2</parameter></methodparam>
<methodparam><type>float</type><parameter>y2</parameter></methodparam>
<methodparam><type>float</type><parameter>width</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_defineline</function> defines a line starting
from the x coordinate given by <parameter>x1</parameter> and the
y coordinate given by <parameter>y1 </parameter> parameter. Up
to the x coordinate given by the <parameter>x2</parameter>
parameter and the y coordinate given by the
<parameter>y2</parameter> parameter. It will have a width
defined by the <parameter>width</parameter> parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-definerect">
<refnamediv>
<refname>swf_definerect</refname>
<refpurpose>Define a rectangle</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_definerect</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
<methodparam><type>float</type><parameter>x1</parameter></methodparam>
<methodparam><type>float</type><parameter>y1</parameter></methodparam>
<methodparam><type>float</type><parameter>x2</parameter></methodparam>
<methodparam><type>float</type><parameter>y2</parameter></methodparam>
<methodparam><type>float</type><parameter>width</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_definerect</function> defines a rectangle with
an upper left hand coordinate given by the x,
<parameter>x1</parameter>, and the y, <parameter>y1</parameter>.
And a lower right hand coordinate given by the x coordinate,
<parameter>x2</parameter>, and the y coordinate, <parameter>y2
</parameter>. Width of the rectangles border is given by the
<parameter>width</parameter> parameter, if the width is 0.0 then
the rectangle is filled.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-definepoly">
<refnamediv>
<refname>swf_definepoly</refname>
<refpurpose>
Define a polygon
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_definepoly</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
<methodparam><type>array</type><parameter>coords</parameter></methodparam>
<methodparam><type>int</type><parameter>npoints</parameter></methodparam>
<methodparam><type>float</type><parameter>width</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_definepoly</function> function defines a
polygon given an array of x, y coordinates (the coordinates are
defined in the parameter <parameter>coords</parameter>). The
parameter <parameter>npoints</parameter> is the number of overall
points that are contained in the array given by
<parameter>coords</parameter>. The <parameter>width</parameter>
is the width of the polygon's border, if set to 0.0 the polygon
is filled.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-startshape">
<refnamediv>
<refname>swf_startshape</refname>
<refpurpose>Start a complex shape</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_startshape</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_startshape</function> function starts a complex
shape, with an object id given by the
<parameter>objid</parameter> parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapelinesold">
<refnamediv>
<refname>swf_shapelinesolid</refname>
<refpurpose>Set the current line style</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapelinesolid</methodname>
<methodparam><type>float</type><parameter>r</parameter></methodparam>
<methodparam><type>float</type><parameter>g</parameter></methodparam>
<methodparam><type>float</type><parameter>b</parameter></methodparam>
<methodparam><type>float</type><parameter>a</parameter></methodparam>
<methodparam><type>float</type><parameter>width</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_shapeLineSolid</function> function sets the
current line style to the color of the
<parameter>rgba</parameter> parameters and width to the
<parameter>width</parameter> parameter. If 0.0 is given as a
width then no lines are drawn.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapefilloff">
<refnamediv>
<refname>swf_shapefilloff</refname>
<refpurpose>Turns off filling</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapefilloff</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_shapeFillOff</function> function turns off
filling for the current shape.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapefillsolid">
<refnamediv>
<refname>swf_shapefillsolid</refname>
<refpurpose>
Set the current fill style to the specified color
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapefillsolid</methodname>
<methodparam><type>float</type><parameter>r</parameter></methodparam>
<methodparam><type>float</type><parameter>g</parameter></methodparam>
<methodparam><type>float</type><parameter>b</parameter></methodparam>
<methodparam><type>float</type><parameter>a</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_shapeFillSolid</function> function sets the
current fill style to solid, and then sets the fill color to the
values of the <parameter>rgba</parameter> parameters.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapefillbitmapclip">
<refnamediv>
<refname>swf_shapefillbitmapclip</refname>
<refpurpose>
Set current fill mode to clipped bitmap
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapefillbitmapclip</methodname>
<methodparam><type>int</type><parameter>bitmapid</parameter></methodparam>
</methodsynopsis>
<para>
Sets the fill to bitmap clipped, empty spaces will be filled by
the bitmap given by the <parameter>bitmapid</parameter>
parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapefillbitmaptile">
<refnamediv>
<refname>swf_shapefillbitmaptile</refname>
<refpurpose>
Set current fill mode to tiled bitmap
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapefillbitmaptile</methodname>
<methodparam><type>int</type><parameter>bitmapid</parameter></methodparam>
</methodsynopsis>
<para>
Sets the fill to bitmap tile, empty spaces will be filled by the
bitmap given by the <parameter>bitmapid</parameter> parameter
(tiled).
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapemoveto">
<refnamediv>
<refname>swf_shapemoveto</refname>
<refpurpose>Move the current position</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapemoveto</methodname>
<methodparam><type>float</type><parameter>x</parameter></methodparam>
<methodparam><type>float</type><parameter>y</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_shapeMoveTo</function> function moves the
current position to the x coordinate given by the
<parameter>x</parameter> parameter and the y position given by
the <parameter>y</parameter> parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapelineto">
<refnamediv>
<refname>swf_shapelineto</refname>
<refpurpose>Draw a line</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapelineto</methodname>
<methodparam><type>float</type><parameter>x</parameter></methodparam>
<methodparam><type>float</type><parameter>y</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_shapeLineTo</function> draws a line to the x,y
coordinates given by the <parameter>x</parameter> parameter & the
<parameter>y</parameter> parameter. The current position is then
set to the x,y parameters.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapecurveto">
<refnamediv>
<refname>swf_shapecurveto</refname>
<refpurpose>
Draw a quadratic bezier curve between two points
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapecurveto</methodname>
<methodparam><type>float</type><parameter>x1</parameter></methodparam>
<methodparam><type>float</type><parameter>y1</parameter></methodparam>
<methodparam><type>float</type><parameter>x2</parameter></methodparam>
<methodparam><type>float</type><parameter>y2</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_shapecurveto</function> function draws a
quadratic bezier curve from the x coordinate given by
<parameter>x1</parameter> and the y coordinate given by
<parameter>y1</parameter> to the x coordinate given by
<parameter>x2</parameter> and the y coordinate given by
<parameter>y2</parameter>. The current position is then set to
the x,y coordinates given by the <parameter>x2</parameter> and
<parameter>y2</parameter> parameters
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapecurveto3">
<refnamediv>
<refname>swf_shapecurveto3</refname>
<refpurpose>Draw a cubic bezier curve</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapecurveto3</methodname>
<methodparam><type>float</type><parameter>x1</parameter></methodparam>
<methodparam><type>float</type><parameter>y1</parameter></methodparam>
<methodparam><type>float</type><parameter>x2</parameter></methodparam>
<methodparam><type>float</type><parameter>y2</parameter></methodparam>
<methodparam><type>float</type><parameter>x3</parameter></methodparam>
<methodparam><type>float</type><parameter>y3</parameter></methodparam>
</methodsynopsis>
<para>
Draw a cubic bezier curve using the x,y coordinate pairs
<parameter>x1</parameter>, <parameter>y1</parameter> and
<parameter>x2</parameter>,<parameter>y2</parameter> as off curve
control points and the x,y coordinate
<parameter>x3</parameter>,<parameter> y3</parameter> as an
endpoint. The current position is then set to the x,y coordinate
pair given by
<parameter>x3</parameter>,<parameter>y3</parameter>.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-shapearc">
<refnamediv>
<refname>swf_shapearc</refname>
<refpurpose>Draw a circular arc</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_shapearc</methodname>
<methodparam><type>float</type><parameter>x</parameter></methodparam>
<methodparam><type>float</type><parameter>y</parameter></methodparam>
<methodparam><type>float</type><parameter>r</parameter></methodparam>
<methodparam><type>float</type><parameter>ang1</parameter></methodparam>
<methodparam><type>float</type><parameter>ang2</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_shapeArc</function> function draws a circular
arc from angle A given by the <parameter>ang1</parameter>
parameter to angle B given by the <parameter>ang2</parameter>
parameter. The center of the circle has an x coordinate given by
the <parameter>x</parameter> parameter and a y coordinate given
by the <parameter>y</parameter>, the radius of the circle is
given by the <parameter>r</parameter> parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-endshape">
<refnamediv>
<refname>swf_endshape</refname>
<refpurpose>
Completes the definition of the current shape
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_endshape</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_endshape</function> completes the definition of
the current shape.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-definefont">
<refnamediv>
<refname>swf_definefont</refname>
<refpurpose>
Defines a font
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_definefont</methodname>
<methodparam><type>int</type><parameter>fontid</parameter></methodparam>
<methodparam><type>string</type><parameter>fontname</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_definefont</function> function defines a font
given by the <parameter>fontname</parameter> parameter and gives
it the id specified by the <parameter>fontid</parameter>
parameter. It then sets the font given by <parameter>
fontname</parameter> to the current font.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-setfont">
<refnamediv>
<refname>swf_setfont</refname>
<refpurpose>Change the current font</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_setfont</methodname>
<methodparam><type>int</type><parameter>fontid</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_setfont</function> sets the current font to the
value given by the <parameter>fontid</parameter> parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-fontsize">
<refnamediv>
<refname>swf_fontsize</refname>
<refpurpose>Change the font size</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_fontsize</methodname>
<methodparam><type>float</type><parameter>size</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_fontsize</function> function changes the font
size to the value given by the <parameter>size</parameter>
parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-fontslant">
<refnamediv>
<refname>swf_fontslant</refname>
<refpurpose>Set the font slant</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_fontslant</methodname>
<methodparam><type>float</type><parameter>slant</parameter></methodparam>
</methodsynopsis>
<para>
Set the current font slant to the angle indicated by the
<parameter>slant</parameter> parameter. Positive values create a
foward slant, negative values create a negative slant.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-fonttracking">
<refnamediv>
<refname>swf_fonttracking</refname>
<refpurpose>Set the current font tracking</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_fonttracking</methodname>
<methodparam><type>float</type><parameter>tracking</parameter></methodparam>
</methodsynopsis>
<para>
Set the font tracking to the value specified by the
<parameter>tracking</parameter> parameter. This function is used
to increase the spacing between letters and text, positive values
increase the space and negative values decrease the space between
letters.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-getfontinfo">
<refnamediv>
<refname>swf_getfontinfo</refname>
<refpurpose>
The height in pixels of a capital A and a lowercase x
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>swf_getfontinfo</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_getfontinfo</function> function returns an
associative array with the following parameters:
<itemizedlist>
<listitem>
<simpara>
Aheight - The height in pixels of a capital A.
</simpara>
</listitem>
<listitem>
<simpara>
xheight - The height in pixels of a lowercase x.
</simpara>
</listitem>
</itemizedlist>
</para>
</refsect1>
</refentry>
<refentry id="function.swf-definetext">
<refnamediv>
<refname>swf_definetext</refname>
<refpurpose>Define a text string</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_definetext</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
<methodparam><type>int</type><parameter>docenter</parameter></methodparam>
</methodsynopsis>
<para>
Define a text string (the <parameter>str</parameter> parameter)
using the current font and font size. The
<parameter>docenter</parameter> is where the word is centered, if
<parameter>docenter</parameter> is 1, then the word is centered
in x.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-textwidth">
<refnamediv>
<refname>swf_textwidth</refname>
<refpurpose>Get the width of a string</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>float</type><methodname>swf_textwidth</methodname>
<methodparam><type>string</type><parameter>str</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_textwidth</function> function gives the width
of the string, <parameter>str</parameter>, in pixels, using the
current font and font size.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-definebitmap">
<refnamediv>
<refname>swf_definebitmap</refname>
<refpurpose>Define a bitmap</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_definebitmap</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
<methodparam><type>string</type><parameter>image_name</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_definebitmap</function> function defines a
bitmap given a GIF, JPEG, RGB or FI image. The image will be
converted into a Flash JPEG or Flash color map format.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-getbitmapinfo">
<refnamediv>
<refname>swf_getbitmapinfo</refname>
<refpurpose>Get information about a bitmap</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>array</type><methodname>swf_getbitmapinfo</methodname>
<methodparam><type>int</type><parameter>bitmapid</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_getbitmapinfo</function> function returns an
array of information about a bitmap given by the
<parameter>bitmapid</parameter> parameter. The returned array
has the following elements:
<itemizedlist>
<listitem>
<simpara>
"size" - The size in bytes of the bitmap.
</simpara>
</listitem>
<listitem>
<simpara>
"width" - The width in pixels of the bitmap.
</simpara>
</listitem>
<listitem>
<simpara>
"height" - The height in pixels of the bitmap.
</simpara>
</listitem>
</itemizedlist>
</para>
</refsect1>
</refentry>
<refentry id="function.swf-startsymbol">
<refnamediv>
<refname>swf_startsymbol</refname>
<refpurpose>Define a symbol</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_startsymbol</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
</methodsynopsis>
<para>
Define an object id as a symbol. Symbols are tiny flash movies
that can be played simultaneously. The
<parameter>objid</parameter> parameter is the object id you want
to define as a symbol.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-endsymbol">
<refnamediv>
<refname>swf_endsymbol</refname>
<refpurpose>End the definition of a symbol</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_endsymbol</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_endsymbol</function> function ends the
definition of a symbol that was started by the
<function>swf_startsymbol</function> function.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-startbutton">
<refnamediv>
<refname>swf_startbutton</refname>
<refpurpose>Start the definition of a button</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_startbutton</methodname>
<methodparam><type>int</type><parameter>objid</parameter></methodparam>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_startbutton</function> function starts off the
definition of a button. The <parameter>type</parameter>
parameter can either be TYPE_MENUBUTTON or TYPE_PUSHBUTTON. The
TYPE_MENUBUTTON constant allows the focus to travel from the
button when the mouse is down, TYPE_PUSHBUTTON does not allow the
focus to travel when the mouse is down.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-addbuttonrecord">
<refnamediv>
<refname>swf_addbuttonrecord</refname>
<refpurpose>
Controls location, appearance and active area of the current button
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_addbuttonrecord</methodname>
<methodparam><type>int</type><parameter>states</parameter></methodparam>
<methodparam><type>int</type><parameter>shapeid</parameter></methodparam>
<methodparam><type>int</type><parameter>depth</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_addbuttonrecord</function> function allows you
to define the specifics of using a button. The first parameter,
<parameter>states</parameter>, defines what states the button can
have, these can be any or all of the following constants:
BSHitTest, BSDown, BSOver or BSUp. The second parameter, the
<parameter>shapeid</parameter> is the look of the button, this is
usually the object id of the shape of the button. The
<parameter>depth</parameter> parameter is the placement of the
button in the current frame.
<example>
<title>
<function>swf_addbuttonrecord</function> function example
</title>
<programlisting role="php">
swf_startButton ($objid, TYPE_MENUBUTTON);
swf_addButtonRecord (BSDown|BSOver, $buttonImageId, 340);
swf_onCondition (MenuEnter);
swf_actionGetUrl ("http://www.designmultimedia.com", "_level1");
swf_onCondition (MenuExit);
swf_actionGetUrl ("", "_level1");
swf_endButton ();
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<refentry id="function.swf-oncondition">
<refnamediv>
<refname>swf_oncondition</refname>
<refpurpose>
Describe a transition used to trigger an action list
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_oncondition</methodname>
<methodparam><type>int</type><parameter>transition</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_onCondition</function> function describes a
transition that will trigger an action list. There are several
types of possible transitions, the following are for buttons
defined as TYPE_MENUBUTTON:
<itemizedlist>
<listitem>
<simpara>
IdletoOverUp
</simpara>
</listitem>
<listitem>
<simpara>
OverUptoIdle
</simpara>
</listitem>
<listitem>
<simpara>
OverUptoOverDown
</simpara>
</listitem>
<listitem>
<simpara>
OverDowntoOverUp
</simpara>
</listitem>
<listitem>
<simpara>
IdletoOverDown
</simpara>
</listitem>
<listitem>
<simpara>
OutDowntoIdle
</simpara>
</listitem>
<listitem>
<simpara>
MenuEnter (IdletoOverUp|IdletoOverDown)
</simpara>
</listitem>
<listitem>
<simpara>
MenuExit (OverUptoIdle|OverDowntoIdle)
</simpara>
</listitem>
</itemizedlist>
For TYPE_PUSHBUTTON there are the following options:
<itemizedlist>
<listitem>
<simpara>
IdletoOverUp
</simpara>
</listitem>
<listitem>
<simpara>
OverUptoIdle
</simpara>
</listitem>
<listitem>
<simpara>
OverUptoOverDown
</simpara>
</listitem>
<listitem>
<simpara>
OverDowntoOverUp
</simpara>
</listitem>
<listitem>
<simpara>
OverDowntoOutDown
</simpara>
</listitem>
<listitem>
<simpara>
OutDowntoOverDown
</simpara>
</listitem>
<listitem>
<simpara>
OutDowntoIdle
</simpara>
</listitem>
<listitem>
<simpara>
ButtonEnter (IdletoOverUp|OutDowntoOverDown)
</simpara>
</listitem>
<listitem>
<simpara>
ButtonExit (OverUptoIdle|OverDowntoOutDown)
</simpara>
</listitem>
</itemizedlist>
</para>
</refsect1>
</refentry>
<refentry id="function.swf-endbutton">
<refnamediv>
<refname>swf_endbutton</refname>
<refpurpose>
End the definition of the current button
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_endbutton</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_endButton</function> function ends the
definition of the current button.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-viewport">
<refnamediv>
<refname>swf_viewport</refname>
<refpurpose>Select an area for future drawing</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_viewport</methodname>
<methodparam><type>double</type><parameter>xmin</parameter></methodparam>
<methodparam><type>double</type><parameter>xmax</parameter></methodparam>
<methodparam><type>double</type><parameter>ymin</parameter></methodparam>
<methodparam><type>double</type><parameter>ymax</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_viewport</function> function selects an area
for future drawing for <parameter>xmin</parameter> to
<parameter>xmax</parameter> and <parameter>ymin</parameter> to
<parameter>ymax</parameter>, if this function is not called the
area defaults to the size of the screen.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-ortho">
<refnamediv>
<refname>swf_ortho</refname>
<refpurpose>
Defines an orthographic mapping of user coordinates onto the
current viewport
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_ortho</methodname>
<methodparam><type>double</type><parameter>xmin</parameter></methodparam>
<methodparam><type>double</type><parameter>xmax</parameter></methodparam>
<methodparam><type>double</type><parameter>ymin</parameter></methodparam>
<methodparam><type>double</type><parameter>ymax</parameter></methodparam>
<methodparam><type>double</type><parameter>zmin</parameter></methodparam>
<methodparam><type>double</type><parameter>zmax</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_ortho</function> funcion defines a orthographic
mapping of user coordinates onto the current viewport.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-ortho2">
<refnamediv>
<refname>swf_ortho2</refname>
<refpurpose>
Defines 2D orthographic mapping of user coordinates onto the
current viewport
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_ortho2</methodname>
<methodparam><type>double</type><parameter>xmin</parameter></methodparam>
<methodparam><type>double</type><parameter>xmax</parameter></methodparam>
<methodparam><type>double</type><parameter>ymin</parameter></methodparam>
<methodparam><type>double</type><parameter>ymax</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_ortho2</function> function defines a two
dimensional orthographic mapping of user coordinates onto the
current viewport, this defaults to one to one mapping of the area
of the Flash movie. If a perspective transformation is desired,
the <function>swf_perspective </function> function can be used.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-perspective">
<refnamediv>
<refname>swf_perspective</refname>
<refpurpose>
Define a perspective projection transformation
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_perspective</methodname>
<methodparam><type>double</type><parameter>fovy</parameter></methodparam>
<methodparam><type>double</type><parameter>aspect</parameter></methodparam>
<methodparam><type>double</type><parameter>near</parameter></methodparam>
<methodparam><type>double</type><parameter>far</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_perspective</function> function defines a
perspective projection transformation. The
<parameter>fovy</parameter> parameter is field-of-view angle in
the y direction. The <parameter>aspect</parameter> parameter
should be set to the aspect ratio of the viewport that is being
drawn onto. The <parameter>near</parameter> parameter is the
near clipping plane and the <parameter>far</parameter> parameter
is the far clipping plane.
</para>
<note>
<para>
Various distortion artifacts may appear when performing a
perspective projection, this is because Flash players only have
a two dimensional matrix. Some are not to pretty.
</para>
</note>
</refsect1>
</refentry>
<refentry id="function.swf-polarview">
<refnamediv>
<refname>swf_polarview</refname>
<refpurpose>
Define the viewer's position with polar coordinates
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_polarview</methodname>
<methodparam><type>double</type><parameter>dist</parameter></methodparam>
<methodparam><type>double</type><parameter>azimuth</parameter></methodparam>
<methodparam><type>double</type><parameter>incidence</parameter></methodparam>
<methodparam><type>double</type><parameter>twist</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_polarview</function> function defines the
viewer's position in polar coordinates. The
<parameter>dist</parameter> parameter gives the distance between
the viewpoint to the world space origin. The
<parameter>azimuth</parameter> parameter defines the azimuthal
angle in the x,y coordinate plane, measured in distance from the
y axis. The <parameter>incidence</parameter> parameter defines
the angle of incidence in the y,z plane, measured in distance
from the z axis. The incidence angle is defined as the angle of
the viewport relative to the z axis. Finally the
<parameter>twist</parameter> specifies the amount that the
viewpoint is to be rotated about the line of sight using the
right hand rule.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-lookat">
<refnamediv>
<refname>swf_lookat</refname>
<refpurpose>Define a viewing transformation</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_lookat</methodname>
<methodparam><type>double</type><parameter>view_x</parameter></methodparam>
<methodparam><type>double</type><parameter>view_y</parameter></methodparam>
<methodparam><type>double</type><parameter>view_z</parameter></methodparam>
<methodparam><type>double</type><parameter>reference_x</parameter></methodparam>
<methodparam><type>double</type><parameter>reference_y</parameter></methodparam>
<methodparam><type>double</type><parameter>reference_z</parameter></methodparam>
<methodparam><type>double</type><parameter>twist</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_lookat</function> function defines a viewing
transformation by giving the viewing position (the parameters
<parameter>view_x</parameter>, <parameter>view_y</parameter>, and
<parameter>view_z</parameter>) and the coordinates of a reference
point in the scene, the reference point is defined by the
<parameter>reference_x</parameter>, <parameter>reference_y
</parameter>, and <parameter>reference_z</parameter> parameters.
The <parameter>twist </parameter> controls the rotation along
with viewer's z axis.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-pushmatrix">
<refnamediv>
<refname>swf_pushmatrix</refname>
<refpurpose>
Push the current transformation matrix back unto the stack
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_pushmatrix</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_pushmatrix</function> function pushes the
current transformation matrix back onto the stack.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-popmatrix">
<refnamediv>
<refname>swf_popmatrix</refname>
<refpurpose>
Restore a previous transformation matrix
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_popmatrix</methodname>
<void/>
</methodsynopsis>
<para>
The <function>swf_popmatrix</function> function pushes the
current transformation matrix back onto the stack.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-scale">
<refnamediv>
<refname>swf_scale</refname>
<refpurpose>Scale the current transformation</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_scale</methodname>
<methodparam><type>double</type><parameter>x</parameter></methodparam>
<methodparam><type>double</type><parameter>y</parameter></methodparam>
<methodparam><type>double</type><parameter>z</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_scale</function> scales the x coordinate of the
curve by the value of the <parameter>x</parameter> parameter, the
y coordinate of the curve by the value of the
<parameter>y</parameter> parameter, and the z coordinate of the
curve by the value of the <parameter>z</parameter> parameter.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-translate">
<refnamediv>
<refname>swf_translate</refname>
<refpurpose>Translate the current transformations</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_translate</methodname>
<methodparam><type>double</type><parameter>x</parameter></methodparam>
<methodparam><type>double</type><parameter>y</parameter></methodparam>
<methodparam><type>double</type><parameter>z</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_translate</function> function translates the
current transformation by the <parameter>x</parameter>,
<parameter>y</parameter>, and <parameter>z</parameter> values
given.
</para>
</refsect1>
</refentry>
<refentry id="function.swf-rotate">
<refnamediv>
<refname>swf_rotate</refname>
<refpurpose>Rotate the current transformation</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_rotate</methodname>
<methodparam><type>double</type><parameter>angle</parameter></methodparam>
<methodparam><type>string</type><parameter>axis</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_rotate</function> rotates the current
transformation by the angle given by the
<parameter>angle</parameter> parameter around the axis given by
the <parameter>axis</parameter> parameter. Valid values for the
axis are 'x' (the x axis), 'y' (the y axis) or 'z' (the z axis).
</para>
</refsect1>
</refentry>
<refentry id="function.swf-posround">
<refnamediv>
<refname>swf_posround</refname>
<refpurpose>
Enables or Disables the rounding of the translation when objects
are placed or moved
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>void</type><methodname>swf_posround</methodname>
<methodparam><type>int</type><parameter>round</parameter></methodparam>
</methodsynopsis>
<para>
The <function>swf_posround</function> function enables or
disables the rounding of the translation when objects are placed
or moved, there are times when text becomes more readable because
rounding has been enabled. The <parameter>round</parameter> is
whether to enable rounding or not, if set to the value of 1, then
rounding is enabled, if set to 0 then rounding is disabled.
</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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
|