Flashsolediter.exe with flash graphical data one

Source: Internet
Author: User
By Bryan Mattern a wooden translation
Introduction to SWF and Flash
SWF is a file format that Macromedia Flash uses to transfer pictures, animations, and sounds to users on the Internet. Flash is the ability to provide users with a rich and dynamic interface. About 90% of web users can browse SWF content without installing a browser plugin, and more than 200 million people have downloaded flash players. Macromedia published the SWF specification in April 1998. Added support for SWF in PHP4.
PHP built-in ability to dynamically generate images is a feature that attracts me. It can generate reports and interfaces that look more professional and more comfortable. At first, I used the various GD codes that flooded the web to create pictures to show the data for my different projects. But I soon got bored with the uncertainty of the resulting picture, and decided to try to solve the problem with vector graphics. I think you will agree, the result looks much better. If a picture can represent 1000 words, imagine what a flash animation stands for?
I will try to make this example simple, just to say the basics of something. My goal is simply to create a drog in that accommodates GD-generated GIF and PNG images. You can add extensions and enhancements to it, such as the various visual effects that flash is known for. For example, you can make a graphic fade in, fly, or animate a few snowflakes as you load the page. Your imagination is the only limit to the SWF function of PHP.
How to get the data that needs to be graphical is best left to the reader for practice. Because this article is about creating flash files dynamically, I'll use an imaginary table as a dataset in the example to create a graphical view of it. You need to check your data and decide on the most appropriate chart format. In most cases, the pie chart is the right choice, which is also the chart form that I will use for my example. Line, histogram, or area charts can be created in a similar way.
In this example, suppose we send some parcels to several cities, and we look at the proportion of parcels that each city receives. We decided to store the data in the table "City" of the Database "world". Let's first build this table and enter the data needed for this example.
#
# Table structure for table ' city '
#
DROP TABLE IF EXISTS City;
CREATE TABLE City (
city_id int () not NULL auto_increment,
City_name varchar (255) is not NULL,
City_timestamp Timestamp (14),
PRIMARY KEY (city_id)
);
#
# Dumping data for table ' city '
#
INSERT into City VALUES (' 1 ', ' London ', ' 20000917122625 ');
INSERT into City VALUES (' 2 ', ' London ', ' 20000917122626 ');
INSERT into City VALUES (' 3 ', ' London ', ' 20000917122626 ');
INSERT into City VALUES (' 4 ', ' London ', ' 20000917122627 ');
INSERT into City VALUES (' 5 ', ' Paris ', ' 20000917122631 ');
INSERT into City VALUES (' 6 ', ' Paris ', ' 20000917122632 ');
INSERT into City VALUES (' 7 ', ' New York ', ' 20000917122644 ');
INSERT into City VALUES (' 8 ', ' New York ', ' 20000917122645 ');
INSERT into City VALUES (' 9 ', ' New York ', ' 20000917122646 ');
INSERT into City VALUES (' Ten ', ' New York ', ' 20000917122646 ');
INSERT into City VALUES (' One ', ' New York ', ' 20000917122647 ');
INSERT into City VALUES (' n ', ' Hong Kong ', ' 20000917122654 ');
Configure your system to use the SWF
The environment I use is Redhat Linux6.2, Apache 1.3.12, PHP 4.0.2 (compiled as Apache module). If you use PHP in Windows, things will be a little different. You need to download or compile a flash Dll, but you don't need to modify the code.
PHP provides the ability to create Shockwave Flash files through the libswf module of Paul Haeberli. You need to download libswf from http://reality.sgi.com/grafica/flash/. Then you need to use option--with-swf[=dir] to configure PHP, where dir is the directory where the include and Lib directories reside. The Include directory must have a swf.h file, and a LIBSWF.A file must be in the Lib directory. When extracting the downloaded libswf release, the two files are extracted to the same directory. You need to move the two files to the correct location. When finished, the directory structure should look like this:
/usr/local/swf/
/include/
Swf.h
/lib/
Libswf.a
/fonts
...
In order for the SWF function to work correctly, you need to copy the/usr/local/swf/fonts/directory so that the Web server can access the directory (the best way for Apache and mod_php is to use absolute paths, and copy the above directories to the Apache document root directory. In addition, there is a very small C program in the release version of LIBSWF, which converts fonts of type 1 into fonts that can be used by flash.
Because we want to create and write SWF files dynamically, the Web server needs to have write access to the directory where the files are stored.

The above describes the Flashsolediter.exe with flash graphical data one, including the flashsolediter.exe aspects of the content, I hope that the PHP tutorial interested friends to help.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.