日期:2013-12-27 浏览次数:20165次

  BitmapData类的noise方法轻松创建电视花屏效果。点击查看Flash:
http://space.flash8.net/bbs/attachment.php?aid=311480

主场景第一帧:
右键菜单 = new ContextMenu();
右键菜单.hideBuiltInItems();
右键菜单.customItems.push(new ContextMenuItem(’sxl001’, dj_menu0, false));
function dj_menu0() {
        getURL(’http://space.flash8.net/space/?572002’, ’_blank’);
}
_root.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);