BitmapData class noise method to easily create a TV flower screen effect

Source: Internet
Author: User
Create a BitmapData class noise method to easily create a TV flower screen effect. Click to view Flash:
http://space.flash8.net/bbs/attachment.php?aid=311480

Main scene First frame:
Right-click menu = new ContextMenu ();
Right-click menu. Hidebuiltinitems ();
Right-click menu. Customitems.push (New Contextmenuitem (' sxl001 ', dj_menu0, false));
function dj_menu0 () {
GetURL (' http://space.flash8.net/space/?572002 ', ' _blank ');
}
_root.menu = right button menu;
Stage.scalemode = "Noscale";
Import Flash.display.BitmapData;
var mybitmapdata:bitmapdata = new BitmapData (400, 300);
This.createemptymovieclip ("MyMovieClip2", 1);
mymovieclip2._x = mymovieclip0._x;
mymovieclip2._y = mymovieclip0._y;
Mymovieclip2.attachbitmap (Mybitmapdata, 1);
_GLOBAL.K = 1;
function Run () {
if (mymovieclip0._currentframe>7) {
Mymovieclip0.gotoandstop (1);
}
Mybitmapdata.noise (Math.floor (1000*math.random ()), 0, 255, 1 | 2 | 4 | 8, FALSE);
Mymovieclip2._alpha-= 2;
if (mymovieclip2._alpha<=1) {
k++;
Mymovieclip2._alpha = 100;
Mymovieclip0.nextframe ();
for (var i = 1; i<=7; i++) {
if (i = = k) {
this["M" +i].mm.gotoandstop (2);
} else {
this["M" +i].mm.gotoandstop (1);
}
}
if (k>7) {
K = 1;
M1.mm.gotoAndStop (2);
Mymovieclip0.gotoandstop (1);
}
}
}
for (var i = 1; i<=7; i++) {
this["M" +i].gotoandstop (i);
this["M" +i].mm.gotoandstop (1);
}
Mymovieclip0.gotoandstop (1);
M1.mm.gotoAndStop (2);
_root.onenterframe = run;
for (var i = 1; i<=7; i++) {
this["M" +i].no = i;
this["m" +i].onpress = function () {
Delete _root.onenterframe;
_root.onenterframe = run;
for (var j = 1; j<=7; j + +) {
if (j = = this.no) {
K = J;
_root.mymovieclip0.gotoandstop (j);
_root["M" +j].mm.gotoandstop (2);
} else {
_root["M" +j].mm.gotoandstop (1);
}
}
};
}

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.