To load multiple external SWF code collation synchronously

Source: Internet
Author: User
Load this I remember is very early to learn, so today and put out the decentralized, user-friendly query use:

function Manyloadmovie (num, x, y, xscal, yscal, dis) {
for (var i = 0; i<num; i++) {
var temp = createemptymovieclip ("temp" +i, i);
var L = createemptymovieclip ("Load" +i, i+num);
TEMP.T = i;
L.loadmovie (i+ ". swf");
L._xscale = xscal;
L._yscale = yscal;
l._x = X+i*dis;
l._y = y;
T = Createtextfield ("txt" +i, i+10000, l._x, l._y, 100, 100);
Temp.onenterframe = function () {
var a = this._parent["Load" +this.t].getbytesloaded ();
var b = this._parent["Load" +this.t].getbytestotal ();
this._parent["txt" +this.t].text = Int (a*100/b) + "%";
if (A>=b and a>10) {
this._parent["TXT" +this.t].removetextfield ();
This.removemovieclip ();
}
};
}
}
Manyloadmovie (4, 100, 100, 50, 50, 50);

Parameters are the number of files, start x, start Y, width ratio, height ratio, arrange spacing.

Note that external files are 0.swf,1.swf,2.swf ... Incremental, actually slightly changed, loading pictures also the following is the file packaging:

[Download source files] (Note:)

Because this function is used on many websites, so I think it is very useful, here just show the percentage, the test time ctrl+enter two times on the line, the external file is bigger and more obvious, as the progress of the article is also very easy, we get it, I die, cold too serious, runny nose ....



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.