Flash website commonly used preload special effects

xiaoxiao2021-03-06  90

Author: bluepoint8101 FLASH website commonly used pre-loaded effects anatomy flash site with its cleverly crafted, colorful for the most avant-garde designers favored. It gives people the visual, sound impact of sound, and has a huge attraction with the design of traditional webpages. In view of the problem of network speed, we need to consider making loading to improve the Flash site. If there are a lot of external WSF files that need to be loaded into the SWF file, what can I achieve? Today, let's explore the production method of the preload page similar to the famous site 2advanced (http://www.2advanced.com/). (Specific effects to log in to the website) First learn the general loading production ideas. It is implemented with ActionScript. Newly built, this layer is specifically placed, the first frame, ifframeloaded ("Scene", Frame) {// If the scene in the scene has loaded into the goto and play ("start") // jump to and play a certain Van (the frame label set by yourself)} The second frame, Goto and Play ("Scene 1", 1) // Skip to the first fluent loop plus a LOAD MC loop play in the middle of these two frames It is OK. Many newcomers are very confused with the external SWF called on LoadMovie. In fact, it is very simple. If it is loadMovienum, the first frame of the first SWF file in the call plus AS: this._x = 100; this._y = 200; (this coordinate is the location coordinate of the external SWF in the main SWF scene ); If the loadMovie statement calls SWF to an empty MC, just put the empty MC in the upper left corner of the location you require the outside SWF, such as coordinates (100, 200). If you want to achieve precise download, there is a wonderful function on Flash 5: getBytesLoaded () and getBytestotal (). Among them: getBytesLoaded () allows us to get the number of bytes already downloaded, and getBytestotal () tells us how many bytes of this file. We do a dynamic text on the home scene to set the variable for INPUT, BAR is a rectangular example name, which is 100, then turn the BAR length on the stage to 1. Add in the first frame as: _root.onLoad = function () {totalBytes = _root.getBytesTotal ();} _root.onEnterFrame = function () {loadedBytes = _root.getBytesLoaded (); percentDone = int ((loadedBytes / totalBytes) * 100); // Display the download schedule is number% OUTPUT = percentddone "% of file loaded"; // The X size of the progress bar is download progress percentdone _root.bar._xscale = percentddone; // If load is completed if (Percentdone> = 100) {// goto frame 2 this.gotoAndStop (2); // Terminate this loop _root.onterframe = null;}}; general logic ideas See the figure below: Ok, through the two loading, I believe that you are familiar with the steps of loading. We start formal preload making. First: New film. The size is 550 × 400, the color is black.

Draw a rectangle of length width of 54, 18 with a rectangular tool. Press CTRL F8 to transition to buttons. To beautify, you can build a keyframe in the ROLLOVER zone, turn the color of the rectangle to red. Second: Pull the button you just made from the library to the editing area. A total of three (this is the benefits of making components, you can reuse ^ _ ^) and arrange them horizontally. Create a new layer, select the text tool to write on each button: Button 1, Button 2, Button 3, the font color is black. Third: Draw a rectangle without a full-filled, blue border in the editing area, open the properties panel, and enters 550, 184 for a long, wide value. The coordinates are 0, 180, and the carriage return is determined. Press CTRL F8 to transform it into a movie clip, and instance is named for Content. The same method creates a new component name Control, create a blank keyframe in the second frame, draw a white rectangle in the editing area, the length width is 0.5, the coordinate is (0, 0). Press F6 to build a keyframe on the 40th frame. On the twentieth frame, a key frame is built, and the rectangle is long and the rectangle is widely fixed to 550, 184. Its coordinates are (-275, -92). Ok, right click between 1 and 20 frames, 20 and 40 frames, select the first option (Create Motion Tween) to create an animation. Create a layer, add a blank key frame at 20 frames, draw a rectangle, and turn it into a movie clip (instance name loadbar). Under the new layer, in the first frame plus the statement: stop (); in 20 frame plus statement: stop (); // load we need SWF file (back production) loadmovie (_root.nextMovie, _root.content); // Nextmovie This SWF file is loaded into the Content this MC. Select 2, 21 frames, give the frames from the attribute panel to the frame (the term frame tag). 2 frames are "close", 21 frames are "open". Built another layer, plus a movie clip loadbar 20 frames. As described above, it is an instance name of a rectangular strip having a length of 100, and then the length of the LoadBar becomes 1 on the stage. This movie clip is done. Fourth: Back to the main scene. The three buttons we do will follow the examples of BT1, BT2, BT3. Then drag the Control element to the scene from the library, and the coordinates are (275,200) (note that our CONTROL component is empty, so you can only see a small circle in the scene. I am impatient, huh, huh, I am in order to take care of beginners, I am not a decept fee.) Now look at your editorial area, you should like the following picture: Fifth: New floor, in the first Frame write code: stop (); but1.onrelease = function () {// Set a variable to store the SWF file name we want to Load NEXTMOVIE = "content1.swf"; // tells Over MC to play the Close animation.

转载请注明原文地址:https://www.9cbs.com/read-122212.html

New Post(0)