A CCTV lottery effect tutorial and source code distribution

Source: Internet
Author: User
Tutorial a CCTV lottery effect
1, first build a folder called Phonenum, which put a file called Phonenum.txt, in the Phonenum.txt input phone number such as:
numleng=21&n1=1331*345678&n2=133987*5432&n3=133456*8987&n4=1333*165432&n5=1353*165231& N6=1369*184762&n7
=1365*695477&n8=1369*835354&n9=13624*87539&n10=1362495*268&n11=135*5275947&n12=1364232*859 &n13=1357549*356&n14
=135845*7586&n15=135241*4125&n16=1365959*458&n17=136542*2266&n18=13699*88588&n19=139*5847* 88&n20=135987*5223&n21
=1367*342143& (Special note: The number for random write if there is a similar coincidence. )
2, a new named "Spring Festival Gala" file, the scene is 400*300, frame frequency of 24.
The main scene 1th frame on the establishment of 8 layers, BJ, BTN, number, TXT, line, WORDSBJ, words, as
This is mainly to explain the 1th frame of as layer:
var nobody = [];
var changenum = new Loadvars ();
System.usecodepage = true;
Get the phone number from an external phonenum/phonenum.txt file so you don't have to modify the source
Changenum.load ("Phonenum/phonenum.txt");
Changenum.onload = function (suc) {
if (suc) {
var Numsleng = Changenum.numleng;
Get the total number of phone numbers
for (var i = 1; i<=numsleng; i++) {
NOBODY[I-1] = changenum["n" +i];
Save all phone numbers in an array
}
}
};
function MC () {
Onenterframe = function () {
t = random (10);
_root.abc.text = Nobody[t];
The following is the sending variable to the background
OUTLC = new LocalConnection ();
Outlc.send ("Lcname", "MSG", _root.abc.text);
Delete OUTLC;
//
};
}
Stars_mc._visible = false;

3, another to build a Getmsg.fla file, its 1th frame on as:
var myarray = [];
INLC = new LocalConnection ();
inlc.msg = function (myData) {
Inmsg.text = MyData;
Nums.text = Myarray.push (MyData);
};
Inlc.connect ("Lcname");
var i = 0;
Btn.onrelease = function () {
i++;
for (var j = 1; j<=10; j + +) {
if (i = = j) {
_root["num" +j] = Inmsg.text;
}
}
}

Open the two SWF files at the same time to see the effect. Click here to download the source file

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.