System Requirements:
1. Macromedia's Flash MX Software, the latest version is Simplified Chinese 2004;
2. Macromedia Extension Manager, Manage Macromedia Software Series Software Package, providing expandability support for Fireworks, Flash, Dreamweaver and other software;
3. Flash Charting Components, a plug-in for a statistical graphic, providing a statistical graphic of three formats: linear chart, pie chart and column chart.
Advantage:
1. No COM components are installed on the web server;
2. Reduce the web server load process because the server side only needs to provide data generating statistical graphics, while the graphics are completed in the client;
3. Flash Charting Components supports all server scripts such as ASP, ASP.NET, JSP, PHP, Perl, CGI, and CF, etc.
4. With Flash Charting Components, there is a lot of advantages, making Banner, protecting web data, etc. This will not be introduced, everyone is excavated.
Production process:
1. If there is no Macromedia's Flash MX Software, please download a installation;
2. Install Macromedia EXTENSION Manager;
3. Install Macromedia Flash Charting Components for Macromedia's Flash MX Software with Macromedia Extension Manager. The method is to run the Macromedia Extension Manager and select "Install Extension ..." in the "File" menu. Enter the flash chat component in the pop-up dialog box, click "Install", in line, after the installation is installed:
Figure 1. Create the first static statistical graph; 1 Open Flash MX, create a new document, double-click the default layer to name a name, such as Bar Chart and set it to 400px and 300px, as shown in Figure 2: Figure 2 2 Open the component template (CTRL-F7), expand "Flash Charting Components", dragging a statistic graphic to your layer scene, this article uses the column graphics (Bar Chart), give it a name, such as Movchart Setting its width and height of 390px and 290px, as shown in Figure 3: Figure 3 and then writing a control script. Create a layer, name it to Actions, press F9 to open the script edit box, enter the Actions script in the edit box: Figure 4 4 as how to write, everyone can help, the simplest is on the script editing box Click the " " button, then select the corresponding component in the drop-down menu, then select the method in the component's extension menu, and finally select a specific method to add to the script edit box, enter the corresponding parameters in the Scripting box. After writing, click the grammatal check to see if your input is wrong, the wrong change is changed, it is not worth it :); 5 Finally in the "File" menu Select "Export -> Export Movie", save to your local directory . At this point, your first chart is done, choose to open this file in IE, look at the actual effect, as shown in Figure 5: Figure 51. Create a dynamic statistical graphics; 1 how to create a basic static statistical graphic, next how to create a dynamic statistics graphic 2 Before creating a dynamic statistics graphic, let's take a look at how Flashcharts work . I. First, FlashCharts is a movie format of XML document data that can accept predefined image structural parameters from the server side. And interpret this XML document data as its own image format. So, we must first know how XML define image parameters, and then understand how to use XML document data in FlashCharts to generate images. II. The above data communication mode can be represented by the following figure: Figure six III. The above mode can be simply elaborated in the following steps: a. HTML issues a URL page request containing SWF files and XML documents to FlashCharts, as shown below:
...
Object>
b. After the FlashCharts receives the request, immediately request XML document data to the URL;
C. The URL is generated from the database to generate an XML document from the database and put it in the output stream;
d. FlashCharts receives XML document data and pressing parameters and data defined in the XML document to represent it as a graphic format.
IV. Now let's take a look at the structure of XML document data. As shown in the following example:
graph>
a. Chaphaphy element in the graphy element specifies the use of that statistical graphic format;
b. CAPTION in the graphy element indicates what the topic of the chart;
C. Xaxisname in the graphy element indicates what the theme of the horizontal coordinates of the chart;
d. Yaxisname in graphy element indicates the topic of the vertical coordinates of the statistical figure;
e. The nodes in the graphy element contain specific horizontal, longitudinal coordinate data, and connections.
3 Next, make a dynamic statistics chart, just like the static chart in front, open Flash MX software.
I. Newly created a 400x300px film;
II. Open the scene panel (SHIFT F2), rename the default scene to loading, and then create a scene named Chart. As shown in Figure 7:
Figure 7
Description: Loading scenario shows the graphic seen from the time of the time to load the chart. The Chart scene is the dynamic statistics graphics that actually wants to see.
III. In the Loading scenario, you can set it, introduce, advertisement, etc., according to actual needs; in this scenario we need to implement two functions:
a. Getting the size of the film and the size of the movie already loaded, the method is to create a new layer in the Loading scenario, create a new keyframe in the layer, enter the following code in the frame of the frame:
Totalbytes = _root.getbytestotal ();
LoadedBytes = _Root.getbytesloaded ();
b. Compare the size of the two, processed accordingly, the code is as follows: if (loadedBytes // Show this scenario gotoandplay ("start"); } else { // Go to Chart scene GotoandPlay ("Chart", "LOADXML"); } IV. Back to the Chart scene, create layers and frames as shown in Figure 8. Figure eight Now don't worry about what is created above, will introduce one by one; V. Create the following keyframes to the Labels layer in Figure 8: Frame 1 Loadxml Frames of XML data in the background Frame 2 LoadingXML A frame that pops up when loading data Frame 3 Parsexml Analyze the data and load frames in array and variables Frame 4 SetDefaults Decided to show the frame of statistical graphics in that format Frame 5 Barchart Show frame of histogram Frame 6 Linechart Display frame of linear graph Frame 7 PieChart Show frame Frame 8 Xmlerror Display the frame of the error message Will stay (below) http://www.9cbs.net/develop/read_article.asp?id=22592