• 语句制作飘动效果(Flash_as2.0实例)


    先抠个飘带,或者画一个,转为影片剪辑,实例名称:cd
    加个图层,输入下面的语句(2.0文档)

    Stage.scaleMode = "noScale";

    var baseX = 100;

    var baseY = 100;

    var nOctaves = 1;

    var randomSeed = Math.random() * 10;

    var bStitch = false;

    var bFractalNoise = true;

    var nChannels = 1;

    var bGreyScale = false;

    var p1 = new flash.geom.Point(45, 34);

    var p2 = new flash.geom.Point(50, 60);

    perlinOffset = new Array(p1, p2);

    bmp = new flash.display.BitmapData(750, 600, true, 0);

    onEnterFrame = function ()

    {

    perlinOffset[0].y = perlinOffset[0].y - 8;

    perlinOffset[0].x = perlinOffset[0].x - 8;

    perlinOffset[1].x = perlinOffset[1].x + 1;

    perlinOffset[1].y = perlinOffset[1].y + 1;

    bmp.perlinNoise(baseX, baseY, nOctaves, randomSeed, bStitch, bFractalNoise, nChannels, bGreyScale, perlinOffset);

    dmf = new flash.filters.DisplacementMapFilter(bmp, new flash.geom.Point(0, 0), 1, 1, 20, 20, "color");

    cd.filters = [dmf];

    };

    对该影片剪辑可添加图层混合模式和滤镜其它效果。测试影片。

    注:

    (1)飘动的面积大小在“bmp = new flash.display.BitmapData(750, 600, true, 0);”中修改

    (2)飘动的幅度可在“var baseX = 100;var baseY = 100;”中修改
    2017/1/7 1:07:52
举报不良信息

 

 大  小