Make an external load progress bar in the main movie

Source: Internet
Author: User
Tags insert

Making loading is a cliché, but a lot of friends are making flash pages about how to load the progress bar of an external movie in the main movie, and I think that's why you can simplify the production of external movies. Below I put the method of making a brief introduction to everybody. (Do not know that there have been no friends have sent such articles, such as similar, it is a coincidence!) The demo of this source file can only be seen here: http://yatu.512j.com

began to produce:

(a) Press Ctrl+f8 to create a new movie clip, named "Tiao", then select the Rectangle tool and pull a bar right from the center point of the scene. As shown in Figure 1

(ii) Press CTRL+F8 to create a new movie clip named "Loading" press Ctrl+l to open the library and drag the movie clip "Tiao" from the library into the scene, taking the instance named "Jdt". As shown in Figure 2

(iii) Select the Text tool, select in the Properties panel-dynamic text box, pull out a text box, the variable named "BFB" as shown in Figure 3

(d) Back to the main scene, insert the keyframe in frame 50th, drag the movie clip "Loading" from the library into the main scene, and take the instance named "Loading" as the progress bar. (Note: This setting will start loading external animations when the movie is played to frame 50th, which is customized according to your design requirements) as shown in Figure 4

(v) Create a new layer, insert the keyframe in frame 50th, and add the code. As follows:

Loadmovienum ("mc.swf", 2)//To load the external video MC to Tier 2
Loading.onenterframe = function () {//Loop to get progress
A = _level2.getbytesloaded ()//Get the number of bytes downloaded, notice that I load the external movie to level 2
b = _level2.getbytestotal (); Get the total number of bytes in the animation
LOADING.BFB = Int (a/b*100) add "%";//Get Download percent
Loading.jdt._xscale = (a/b*100);//Get progress bar Horizontal Scaling value
if (a = = b) {//If the download is complete, cancel the loop and start playing the downloaded animation
Delete Loading.onenterframe;
Telltarget ("_level2") {
Play ();
}
}
};
Stop ();



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.