Full Flash station production analysis _flash as

Source: Internet
Author: User
Tags html page perl script
Author: Li Hongming

After a period of flash learning, many friends began to be interested in the production of all the flash sites. All flash site mainly graphics and animation, so it is more suitable to do those text content is not too much to plane, animation effect of the main application. such as: Corporate brand promotion, specific online advertising, online games, personalized sites and so on.

Create a full flash site similar to making an HTML site, first of all, you should draw a structure diagram on the paper, including: the theme of the website, what elements to use, what elements need to be reused, the links between elements, how elements move, what style of music, the whole site can be divided into several logical blocks, The connection between each logical block, and whether you plan to use Flash to construct the whole station or use it to do the prophase part of the website and so on, should be considered within the scope.

Realize the full flash site has a variety of effects, but the basic principle is the same: the main scene as a "stage", the stage provides a standard height-to-width ratio and the entire layout structure, "Actor" is the specific content of the site sub-column, according to the content structure of the sub column may be derived more sub columns. The main scene as a "stage" basis, basically keep their content unchanged, the other "actor" identity of the subclass, second-class content as needed to be imported into the main scene.

Technically, if you have mastered a number of individual flash works of the production methods, and more understanding of some SWF file calls between the method, the production of a full flash site is not too complicated.

Reference flow: Web site structure planning->flash scene planning-> material preparation-> separate-> integral integration

The difference between the whole flash website and the production of individual Flash works

Second, commonly used technology

1. Important ActionScript Code Control

2, the production of loading

3. Text Import

Iii. analysis of the case-making

1, this example website structure planning

2, the first scene index.swf production

3. The production of Cartoon (200208.swf) of the secondary scene

4, two level of the scene (200208_FROG01~200208_FROG05) production

5, about the text import

Iv. Matters of note

Above we through the case analysis of the way to introduce the whole Flash site basic production methods, I hope to like flash friends a little real help, look forward to seeing you soon to make the wonderful flash website! This article Flash website instance source file downloads

The difference between the whole flash website and the production of individual Flash works

1. Different file structure

The scene, animation process, and content of a single flash work are in one file, and the entire Flash site's files are made up of several files and can continue to expand as the need for development continues. All flash Web site files are animated in their respective corresponding files. Animation effects are achieved through import and jump controls on the action, and because multiple SWF files can be loaded at the same time, they overlap and appear on the screen.

2, the production of different ideas

The production of a single flash works in a separate file, planning the animation effect with the change of time line or the alternating change of scene. All Flash Web site production will need to grasp the overall, through the different file switching and control to achieve the dynamic effect of the full flash site, requires the creator has a clear idea and good production habits.

3, the file playback process is different

A single flash work usually requires that the file be made in a file, and the viewing effect must wait for the basic download of the file to begin playing. However, the full flash site is a combination of several files, in time flow more in line with the characteristics of Flash software products. Files can be done relatively small, through the loading of other files more suitable for the spread of the internet, so as to avoid the visitors because the waiting time is too long to give up browsing.



Second, commonly used technology

1. Important ActionScript Code Control

This is the key to all flash site implementation, especially Flash MX added a lot of powerful commands, about this part, please take a look at other information, here is only part of the production of a full flash site need to use the more important ActionScript function.

Loadmovienum ("url", level[, variables])

Loadmovie ("url", level/target[, variables])

Function Description:
Loads the SWF or JPEG file in while playing the original loaded movie.
Parameter description:
The absolute or relative URL of the SWF or JPEG file to be loaded by the URL, and cannot contain a folder or disk drive description.
Level the SWF file is loaded as a layer into the movie, and if you load the 0 layer, the loaded SWF file replaces the currently playing movie. 2 floors above 1 floors.
The target available path picker obtains and replaces the destination MC, and the loaded movie will have properties such as the location, size, and rotation angle of the target MC. (Personally think it is better to use target, it is easier to control loading. SWF location)
Variables an optional parameter that specifies the HTTP method (Get/post) that is used to send the variable, or omit this parameter if it is not.


Hierarchy Level:flash allows multiple SWF files to run at the same time, Flash once loaded into a SWF file, it occupies a "level", the system defaults to _flash0 or _level0, The following movie are placed in the order of level0---level16000. The first loaded SWF file is _flash0 or _level0, and the second is called _FLASH1 or _level1 when it is loaded into the first tier, and so on. Note that the previous loaded file does not exit, or the first SWF file is flushed out, and the first file exits from memory.

Note: If you load the external movie into the LEVE0 layer or Level0, then the original movie will be temporarily replaced, and then you will have to reload once again, that is to say, a level in a time can only have a movie existence. When using Loadmovie and Unloadmovie, you must pay special attention to the relationship between level, otherwise, when you want to play only one movie in a time and unload off the previous movie, there will be unnecessary trouble.

Unloadmovienum (Level)

Unloadmovie[num] (level/"target")

Feature Description: Deletes a loaded movie from Flash Player.
Parameter description: Ditto


Loadvariables ("url", level/"target" [, variables])

Function Description:
Reads data from an external file, such as a text file, or text generated by a CGI script, Active Server Page (ASP), PHP, or Perl script, and sets the value of the variable in the Flash Player level or in the target movie clip.
Parameter description:
The absolute or relative URL of the location where the URL variable is located
Level specifies an integer that receives the levels of these variables in Flash Player.
Target points to the destination path of the movie clip that receives the loaded variable.
Variables an optional parameter that specifies the HTTP method (Get/post) that is used to send the variable, or omit this parameter if it is not.


gotoAndPlay (scene, frame)

Function Description:
Go to the frame specified in the specified scene and start playing from that frame. If no scene is specified, the playhead will go to the specified frame in the current scene.
Parameter description:
Scene the name of the scene to go to.
The number or label of the frame to which the frame is transferred.


2, the production of loading
Considering the speed of the network transmission, if the index.swf file is large, it is necessary to design a loading to guide the viewer to wait patiently before it is fully imported. At the same time the design of a good loading at some time can also be a certain cushion for the site role.

The general practice is to first loading into a MC, the final position of the scene to set the label such as end, through the ifframeloaded to determine whether the download has been completed, if the download is completed through the gotoAndPlay control of the entire flash playback.

Take a loading file for example, insert the MC into the scene,

Ifframeloaded ("End") {
gotoAndPlay ("Place to start playing");
}

3. Text Import

In our production of the whole flash site often encountered a certain amount of text content needs to be reflected in the content of the text and the process described above is the same, different places to reflect the final performance and treatment methods are still a little different.

Method One, text graphic method

If the text content is not much, there is a hope that the text content to do more dynamic effect, you can use this method. You will need the text to make a number of flash components, arranged in the appropriate location. The document loading of the text graphics method is similar to the approach described above, and the principle is almost the same. The concrete dynamic effect waits for everybody to consider, here does not have much introduction.

Method Two, Direct import method

Text Import method can be independent of the TXT text file, through the Loadvariables import into the Flash file, modified only need to modify TXT text content can be implemented flash related file modification, very convenient.

Set VAR: variable name in text Box properties (note this variable name).

Add ActionScript code to the frame where the text box is located:
Loadvariables ("variable name. txt", "");


Write a plain text file. txt (random file name), the text begins with "Variable name =", "=" after the formal text content.

Iii. analysis of the case-making

General production process:

Web site Structure Planning->flash scene planning-> material preparation-> respectively make-> integral integration

1, this example website structure planning

Website column: News, about, e-mail, Gallery, cartoon, Animation

Sub-column About:feiyingis, member, relationship, ContactUs



The red Line part of the home scene (stage), each sub-column in the home page only keep the name, attributes for the button.

The Blue Line part of the content for the second scene (actor), can be done in a secondary scene content in a file, but also can be made into several independent files, as required to import into the home scene (stage).

2, the first scene index.swf production

All flash site from home scene, child scene, second son scene ... Constitute.

and the production of HTML site similar, generally we will make a home scene index.swf, the main content includes: The aspect ratio, the background, the column navigation button, the website name and so on "homepage" information. Finally publish into an HTML file, or make an HTML page of your own, the content is a table, which is written in index.swf embedded code.

Main scene Arrangement:



The Blue Line section is the site name, copyright, and other fixed information areas, usually in the location of the edge of the Flash animation position.

The Orange Line content is the website column navigation button, usually also is fixed in an area. The button can be made static or dynamic according to the need, and can even be made into a button containing the change of MC.

The Green Line section imports the demo area of a child file for the main scene.

The main use of sub-file loading: loadmovienum, unloadmovienum Two control functions, see the previous important ActionScript code control.

Here we take the production of sub-column cartoon as an example. The main scene file index has a button cartoon, when we click on the cartoon button, we want to import the cartoon folder under the 200208.swf file. So we select the cartoon button in the scene and add the action code:

On (release) {
Loadmovienum ("cartoon/200208.swf", 1);
Unloadmovienum (2);
}
Notice here we set the level to 1.

3, the production of the second scene 200208.swf

Now determine the file 200208.swf that the cartoon needs to import, and the file plan contains 5 sub files. So the 200208.swf file interface contains only 5 graphic buttons and a caption for importing 5 separate subfolders.



200208.swf
As you can see from the diagram, the 200208.swf file contains 5 small icons with buttons, bu_2_frog01 to bu_2_frog05 respectively. The effect we need is: Click on them to import the corresponding file 200208_frog01.swf to the 200208_frog05.swf file respectively.

We select Bu_2_frog01 in the scene and add ActionScript for this button:

On (release) {
Loadmovienum ("cartoon/200208_frog01.swf", 2);
}

Click Bu_2_frog02 to add ActionScript for this button:
On (release) {
Loadmovienum ("cartoon/200208_frog02.swf", 2);
}
......
Set the corresponding action of the 5 button individually to invoke the corresponding file.

Note: Here we set the level to 2 to preserve and distinguish the number of levels of imports set by the main scene 1, and if you need to import the layers at the next level, increase the number of layers to 3, and so on.

4, two level of the scene (200208_FROG01~200208_FROG05) production

The two-level scenario here is the content associated with the superior, and is the last level in the three-level structure in this example. This level is mainly for all Flash website specific Content section, can be detailed picture, text, animation content. What you need to connect to is a specific picture, but you need to make a SWF file that is equal to the main scene. For example:



200208_frog01



200208_frog02


The scene is the bottom of the scene, for the main content of the Display section, the specific animation effect you can do as much as needed to do more in-depth. Note To add the stop ActionScript code at the last frame of the scene: Stop (); This stops the looping action of the scene animation.

Effects of full import into the main scene



5, about the text import

View the About sub column of this example and set the action on the About button in the file Index.fla:

On (release) {
Loadmovienum ("aboutus.swf", 1);
Unloadmovienum (2);
}

In the Aboutus.fla file, make a text box that displays text, set the text box property to Multiline (Multiline), and var:aboutus (note the variable name).

Add ActionScript code to the frame where the text box is located:
Loadvariables ("Aboutus.txt", "");

Write a plain text file in the directory of the aboutus.swf file About.txt, the text begins with "aboutus=", and "=" is followed by the formal textual content.



The effect of importing a text file into the main scene completely



Iv. Matters of note

1. Note the long and wide properties of all the files

All flash site from the screen level, very similar to Photoshop layer structure, we can see each child scene as a layer file, the child file is in the context of the long range of appearance. In order to facilitate positioning, we can make the child file and the main scene to maintain a uniform height-to-width ratio, so that the layout is very easy to arrange. Otherwise, you must carefully control their position with the SetProperty statement.

2. Notice that the HTML option is published as transparent mode when you publish the file

The reason that you need to publish each subdocument as transparent is because you cannot have the background color of the child file, because the child file's height-to-width ratio is basically the same as the main scene, and if the sub file has an undertone, it obscures the contents of the main scene.

Setting method: Check the HTML option in the release settings, select Windowsmode:transparentwindowless in the HTML panel, as shown.



3. When using text import, note that the content at the beginning of the text file must be "the same string = body as the var definition name in the text box property." In addition, the SWF file that needs to import text is preferably in the same directory as the TXT text file being imported.

4, pay attention to carefully check the file between the correct call, to avoid the "dead link."

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.