SWF is the file format used by Macromedia Flash to deliver graphics, animation and
sound to users on the Internet. Flash enables you to provide a very rich and dynamic interface to the user.
Almost 90% of web users can view SWF content without having to install a browser based plug-in, and over
200 million people have downloaded the Flash player. Macromedia opened the specifications for SWF in
April 1998 and SWF support was added to PHP in PHP 4(rc2).
PHPs built-in ability to dynamically create images is one feature that impresses me. It makes reports
and interfaces look much more professional and visually pleasing. Initially, I used the various GD
code floating around the net to create the graphs I needed to better represent data for various projects
I had done. I got really sick of the aliasing and choppyness of the generated images, so decided to try
and see if it could be done with vector graphics instead. I think you will agree that the result looks
much better. If a picture is worth a thousand words, wonder what a Flash movie is worth?
In this example, I try to keep things simple and just present the basics. My goal was basically
just create a drop in for GD generated GIFs and PNGs. You can choose to add enhancements, such as any
of the visual effects Flash is famous for. For example, you could make the graph fade in, fly around
into place when the page is loaded or pull pieces of the pie out dynamically. Your imagination is the
only limitation to what can be done with the PHP SWF functions.
How you get the data you choose to graph is an exercise best left up to the reader. Since this
article is about dynamic creation of flash files, I will be using an imaginary table as a data set
to create a graphical representation for this example. You will need to intelligently look at your
data and decide what the best way to present this data will be. In most of the cases, I have
found a pie graph to fit the bill, so this is the example I will use. A line, bar or area graph could
easily be created in a similar manner.
Assume we are trying to see what proportion of cities we shipped our packages of jumbo nightcrawlers to.
We decide to store this data in a table called "city" in our database called "world". Let's get to work
setting up a database table and enter data for the example.
| Comments: |
| RE: YOU CANNOT CRACK FLASH SWF FILES! | Yusup | 08/01/07 23:32 |
| how convert swf to fla | raven | 07/10/07 07:24 |
| RE: Flash maps with PHP? | Daniel P. Fountain | 10/31/05 21:51 |
| RE: convert SWF a SWI | piya | 07/16/05 01:47 |
| It is not possible to convert .swf to .swi | Hala | 07/02/05 11:38 |
| convert | amier | 06/25/05 23:39 |
| FLASH | aniljith gopi k acharya | 06/09/05 04:59 |
| RE: swf to mp3 converter question- SOLUTION | ryanmx | 04/19/05 11:52 |
| convert SWF a SWI | jun | 03/29/05 04:15 |
| RE: PHP code no right click | Kaiser | 02/14/05 17:40 |
| RE: swf to mp3 converter question- SOLUTION | Docta | 09/07/04 02:50 |
| RE: you CAN convert FLA TO SWF with 1.001a | umm | 07/07/04 09:20 |
| Re:nebody have carck for IMPERATOR °FLA Demo | daddy | 05/05/04 04:46 |
| Re:nebody have carck for IMPERATOR °FLA Demo | IMPERATOR SPY | 04/02/04 17:49 |
| Re:nebody have carck for IMPERATOR °FLA Demo | Rohab | 03/24/04 08:25 |
| This program converts .swf to .fla in a flash | IWillHostU.com | 12/18/03 00:56 |
| RE: you CAN convert FLA TO SWF with 1.001a | Jaime | 11/19/03 18:57 |
| RE: you CAN convert FLA TO SWF with 1.001a | Jaime | 11/19/03 18:52 |
| This can convert swf to fla almost | Mike | 04/22/03 04:53 |
| Solution to <How Can I Convert SWF into Fla> | Woddi Di | 03/26/03 13:36 |
| RE: Link to example | pramod | 02/02/03 20:12 |
| RE: you CAN convert FLA TO SWF with 1.001a | Roots*MANUVA | 01/07/03 09:34 |
| RE: Flash cant access/load local files | Mike Chambers | 12/09/02 11:34 |
| A better way | Kyle | 11/21/02 16:21 |
| RE: YOU CANNOT CRACK FLASH SWF FILES!... | goinzo | 11/14/02 03:08 |
| RE: imorting an image | amarnath | 11/13/02 01:51 |
| mov help | adnan | 10/31/02 16:04 |
| swf to mp3 converter question | Gary | 10/15/02 18:23 |
| Migrating to Ming | Josep | 10/14/02 12:31 |
| Link to example | Josep | 10/10/02 12:42 |
| Flash cant access/load local files | sreddy | 10/08/02 12:05 |
| RE: PHP code no right click | hucker | 10/07/02 15:57 |
| RE: I convert SWF a FLA | Mehdi | 09/27/02 14:25 |
| imorting an image | shahane | 09/25/02 01:15 |
| hi im english...does any1 know actionscrpt 4 | clarky | 09/24/02 08:55 |
| opinion! | Rose | 09/17/02 01:06 |
| How can we convert swf into mp3 | reddy | 09/13/02 08:16 |
| RE: I convert SWF a FLA | raven | 09/12/02 08:00 |
| RE: link for libswf | JimBeam | 09/06/02 18:29 |
| Help me- win98+Flash+PHP | joya | 09/06/02 05:51 |
| How can I see php in Flash | joya | 09/06/02 05:33 |
| Including Images | kUNg-f00 | 08/29/02 16:39 |
| A url (php) in flash | jos | 08/29/02 16:04 |
| RE: I need help | sam | 08/28/02 05:50 |
| can we convet .swf into .fla | Hisham Kamal | 08/25/02 01:11 |
| to decompile a SWF file --> | DataBase | 08/22/02 20:29 |
| Salam | Alireza | 08/21/02 07:15 |
| RE: how can I convert swf file into fla | Mike | 08/17/02 03:24 |
| swf fiLE | ALEX | 08/14/02 14:20 |
| I convert SWF a FLA | jayupi | 08/11/02 16:05 |
| PHP Charts | Vineeta | 08/10/02 03:04 |
| display problem | alex_dm | 08/08/02 05:13 |
| RE: how can convert swf file into fla | Chris | 08/06/02 10:56 |
| RE: how can convert swf file into fla | Kathy | 08/04/02 21:15 |
| RE: how can convert swf file into fla | Ammu | 08/04/02 08:41 |
| RE: YOU CANNOT CRACK FLASH SWF FILES!... | Bob Québec | 08/02/02 09:13 |
| RE: how can convert swf file into fla | Ch^Aizak | 07/31/02 01:53 |
| convert swf to fla | Hamid | 07/30/02 06:41 |
| RE: how can convert swf file into fla | Bipul | 07/25/02 03:37 |
| How do I connect SWF & MySQL using PHP | Hemant Kumar Tongaria | 07/24/02 09:02 |
| how can I convert swf file into fla | Manveer | 07/23/02 18:02 |
| RE: YOU CANNOT CRACK FLASH SWF FILES! | Oldfahrt | 07/20/02 14:35 |
| RE: how can convert swf file into fla | melvyn | 07/19/02 07:21 |
| how can convert swf file into fla | mehboob | 07/12/02 12:43 |
| RE: how can convert swf file into fla | noman | 07/05/02 08:17 |
| Convert *.HTML to *.SWF !! | Bogdan | 06/30/02 17:18 |
| SOCKET STREAM -> PHP -> FLASH | David HORVATH | 06/21/02 07:59 |
| PHP code No right click | Lisa | 06/18/02 16:05 |
| PHP code no right click | Lisa | 06/18/02 16:03 |
| SWF to MP3 | Suresh | 06/18/02 10:29 |
| how will I Flash my toilet? | jhoanna klugtod | 06/18/02 02:49 |
| RE: how can convert swf file into fla | poms | 06/15/02 13:52 |
| RE: SWF-->FLA answer: swf-->mp3, too! | belal | 06/14/02 19:47 |
| FLA to SWF withou using flash | Richard | 06/12/02 12:22 |
| setting up html code for flash player | franco medina | 05/29/02 11:09 |
| RE: how can convert swf file into fla | vinay | 05/29/02 08:06 |
| RE: Flash maps with PHP? | zen | 05/21/02 15:20 |
| YOU CANNOT CRACK FLASH SWF FILES! | zen | 05/21/02 15:05 |
| Streaming webcam with flash? | Dexter M | 05/21/02 03:11 |
| RE: how can convert swf file into fla | shahrukh | 05/17/02 15:59 |
| SWF to MP3 | George Cannon | 05/07/02 15:11 |
| Convert mp3 to swf | Daniel Wynn | 04/25/02 20:29 |
| RE: how can I convert mp3 file into fla or sw | Muhammad Adil | 04/25/02 07:03 |
| RE: how can convert swf file into fla | praveen | 04/23/02 02:27 |
| RE: how can convert swf file into fla | Fernando Duarte | 04/16/02 13:19 |
| RE: how can convert swf file into fla | John Mac Kevin | 04/14/02 23:37 |
| RE: sites in flash | ??? | 04/13/02 08:38 |
| flash+database | bia | 04/12/02 14:23 |
| can you're help me | zaini haris | 04/11/02 01:18 |
| sites in flash | Malik | 04/10/02 08:17 |
| how can convert swf file into fla | Malik | 04/10/02 08:15 |
| Urgent! Ming wont run | Earp | 03/19/02 07:07 |
| RE: php +background flash | Earp | 03/19/02 07:04 |
| php + flash | suhail | 02/23/02 11:15 |
| link for libswf | Marty Martini | 02/22/02 14:58 |
| RE: convert swf to mp3 | Vijay | 02/19/02 23:43 |
| forms | jon | 02/19/02 20:25 |
| RE: swf to mp3 | John NASH | 02/19/02 19:17 |
| how can i creat a chat room in flash5 | ilyas | 02/17/02 15:11 |
| RE: Link to example | Robin | 02/15/02 22:07 |
| re: AutoStart Flash | Robin | 02/15/02 21:32 |
| SWF-->FLA answer: swf-->mp3, too! | Alan | 02/13/02 10:25 |
| RE: PHP, Flash, and MySQL | thomas | 02/08/02 08:56 |
| php write to text | curtis | 02/02/02 13:08 |
| Passing Flash Variable to PHP | joe | 01/29/02 22:23 |
| convert swf to fla | wern | 01/26/02 03:58 |
| Power point slide show to SWF file | Salima | 01/24/02 11:21 |
| RE: Flash+php | travis rimel | 01/17/02 10:15 |
| how to access data from .... | joe | 01/15/02 01:55 |
| RE: swf to mp3 | brian | 01/09/02 18:14 |
| RE: SEG-fault | Markus | 01/09/02 16:13 |
| RE: PHP + Flash (arrays) | Greg Trinidad | 01/04/02 03:38 |
| RE: convert swf to mp3 ( answer ) | Xenolab Technologies | 12/27/01 00:08 |
| RE: convert swf to mp3 | Prashanth Enukonda | 12/26/01 03:08 |
| swf to mp3 | yugandar | 12/25/01 12:53 |
| RE: PHP + Flash (arrays) | Simon | 12/12/01 13:49 |
| RE: variables sent right into action script | Volver | 12/04/01 18:16 |
| RE: MACs and swf files | Dave | 12/03/01 15:33 |
| RE: variables sent right into action script | totalmonkey | 11/30/01 12:11 |
| variables sent right into action script | Art Bowles | 11/29/01 12:19 |
| mailform - variables to php to email | Mike Raths | 11/29/01 07:51 |
| RE: convert swf to mp3 | Anil Kumar | 11/24/01 00:43 |
| AutoStart Flash | CyberDev | 11/20/01 08:24 |
| svg2swf | Samson | 11/17/01 06:31 |
| RE: Flash maps with PHP? | Ben-Nes Michael | 11/15/01 10:26 |
| PHP + Flash (arrays) | SoulThief | 11/15/01 02:20 |
| Flash maps with PHP? | Nyunn | 11/08/01 12:36 |
| php +background flash | amarnath | 10/18/01 02:16 |
| Flash+php | amarnath | 10/18/01 02:13 |
| RE: Flash + PHP variable | fraser | 10/10/01 22:17 |
| RE: I need help | Tony | 10/10/01 08:32 |
| Flash + PHP variable | calin c | 10/10/01 07:03 |
| RE: Flash + PHP Variables | Cabdu Emir Rahmed Talem | 10/07/01 23:06 |
| view php message board info in flash | Matthew Throesch | 10/06/01 22:46 |
| APACHE + PHP + SWF errors | Edson Toshiya | 10/04/01 11:55 |
| RE: PHP y FLASH | allbush | 09/20/01 10:35 |
| look for swf lib | Makko | 09/18/01 03:31 |
| convert swf to mp3 | satya | 09/17/01 18:15 |
| flash ->xml ->php problem | SavaJr | 09/16/01 09:08 |
| PHP y FLASH | Sergio | 09/12/01 14:20 |
| RE: Pregunta¿? acá está | sepspv | 08/30/01 21:25 |
| RE: Pregunta¿? | Leonardo | 08/30/01 17:19 |
| Pregunta¿? | sandra | 08/26/01 19:54 |
| Pregunta¿? | sandra | 08/26/01 19:50 |
| reading the width and height of a flash file | tarun | 08/22/01 09:13 |
| FLASH & WEBTV | DeaTH DoLL | 07/25/01 15:04 |
| MACs and swf files | cameo | 07/16/01 19:46 |
| RE: Accessing an already made SWF file | EYES | 06/29/01 10:49 |
| caching | m. sushi | 06/10/01 03:14 |
| Trouble with fonts | Magnus | 05/30/01 22:20 |
| Flash connectivity to MYSQL using PHP | Denrich Sananda | 05/27/01 21:39 |
| RE: Flash + PHP forms | Denrich Sananda | 05/27/01 21:38 |
| change variable-name in existing flash-file | Dorthe Luebbert | 05/21/01 21:45 |
| RE: Win98, PHP, and Flash | iqof188 | 05/16/01 00:16 |
| RE: Detect Flash | Bobbisson | 05/15/01 23:29 |
| Detect Flash | Evan | 05/10/01 10:33 |
| RE: Accessing an already made SWF file | Jerry | 05/10/01 04:02 |
| SWF and URLs | Yoann Riou | 05/09/01 22:40 |
| RE: SEG-fault | Bryan Mattern | 05/03/01 05:17 |
| RE: Free Flash Generator (works with PHP) | Dan Esparza | 04/25/01 01:11 |
| Accessing an already made SWF file | Adam | 04/22/01 22:48 |
| Ming vs SDK | Sharon | 04/20/01 00:06 |
| SEG-fault | Markus | 04/16/01 08:58 |
| List of OpenSource Alternatives to LibSWF | JesseEzell | 03/17/01 03:16 |
| Read the article | Claude | 03/08/01 16:22 |
| RE: color issue... | Nicki | 03/08/01 12:20 |
| color issue... | Nicki | 03/07/01 17:27 |
| color issue... | Nicki | 03/07/01 17:06 |
| RE: Win98, PHP, and Flash | warzog | 03/05/01 04:17 |
| RE: Flash + PHP Variables | Zarek Melton | 03/01/01 19:31 |
| Win98, PHP, and Flash | James Gunn | 03/01/01 12:27 |
| Writing to a Textfile using Flash and PHP4 | Matt | 02/27/01 11:35 |
| XML -> PHP -> SWF | ilya | 02/26/01 00:06 |
| I need help | Andrew | 02/25/01 15:40 |
| Flash + PHP Variables | Zarek Melton | 02/16/01 11:41 |
| Flash + PHP | Gaham Carson | 02/14/01 14:14 |
| RE: PHP, Flash, and MySQL | Monte Shaffer | 02/03/01 11:19 |
| Textures | Johan Daine | 01/25/01 03:32 |
| Just remember... | Jim Bob | 01/24/01 12:26 |
| Who or Who Knows the solution | widios | 01/23/01 05:19 |
| RE: "libswf" swift&generator | flim | 01/20/01 08:51 |
| RE: "libswf" Not Available For Windows | erik | 01/17/01 16:55 |
| swf & swt | Antonis Zachos | 01/17/01 06:51 |
| RE: PHP, Flash, and MySQL | Terence | 01/16/01 09:43 |
| RE: "libswf" Not Available For Windows | Kristof Polleunis | 01/14/01 18:48 |
| RE: Flash + PHP forms | Tahir Ayub | 01/14/01 13:57 |
| RE: Good article Let I BE | James Housley | 01/12/01 22:07 |
| RE: Flash + PHP forms | Brian Busche | 01/12/01 16:30 |
| PHP, Flash, and MySQL | Brian Busche | 01/12/01 16:16 |
| RE: Good article Let I BE | widios | 01/12/01 08:28 |
| RE: "libswf" Not Available For Windows | chris | 01/12/01 04:39 |
| RE: Flash + PHP forms | Luca Pescatore | 01/11/01 16:43 |
| "libswf" Not Available For Windows | Onkar Jagpal | 01/11/01 11:26 |
| Ming... | Mas*Mind | 01/11/01 10:52 |
| Another Flash example | enygma | 01/11/01 09:55 |
| RE: Flash + PHP forms | Bryan Mattern | 01/11/01 09:29 |
| RE: Link to example | Bryan Mattern | 01/11/01 09:27 |
| Good article | toby | 01/11/01 04:31 |
| Flash + PHP forms | Krishna Srinivasan | 01/11/01 01:29 |
| Link to example | aris | 01/11/01 00:40 |
|
If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.
|