Flash CS4 help!
hello, im new beginner flash cs4. trying make candles flame. got first 1 working. consists of 3 layers actionscript layer. tried duplicate 3 layers of images, can work same actionscript layer doesn't work. first one
is working. should duplicated layers of candle work? or there better way make copies of images?
here actionscript layer code:
function draweffect()
{
var _loc2 = offsets.length;
(var _loc1 = 0; _loc1 < _loc2; ++_loc1)
{
offsets[_loc1].y = offsets[_loc1].y + offsetspeeds[_loc1];
} // end of for
noiseimage.perlinnoise(250, 800, 2, seed, true, true, null, true, offsets);
var _loc3 = flamemask.transform.matrix;
_loc3.tx = noise_mc._x;
_loc3.ty = noise_mc._y;
noiseimage.draw(flamemask,_loc3,flamemask.transform.colortransform,"multiply");
noiseimage.applyfilter(noiseimage, noiseimage.rectangle, new flash.geom.point(0, 0), colfilter);
var _loc4 = noiseimage.getcolorboundsrect(4.294967e+009, 4.294967e+009);
var _loc5 = _loc4.height * _loc4.width;
flickerglow((127 - _loc5 / 10) / 1024);
} // end of function
function flickerglow(amount)
{
var _loc1 = new flash.filters.colormatrixfilter([1 + amount, 0, 0, 0, 0, 0, 1 + amount, 0, 0, 0, 0, 0, 1 + amount, 0, 0, 0, 0, 0, 1, 0]);
candlemain.filters = [_loc1];
} // end of function
stage.scalemode = "noscale";
var pxpersecond = 5.000000e-001;
var seed = math.floor(math.random() * 1000000000);
var offsetspeeds = [20, 32];
var offsets = [new flash.geom.point(0, 0), new flash.geom.point(0, 0)];
var flamemask = flamecontainer.flamemask;
var noiseimage = new flash.display.bitmapdata(flamemask._width, flamemask._height, false);
noise_mc = flamecontainer.createemptymovieclip("noise_mc", 1);
noise_mc._x = flamemask._x;
noise_mc._y = flamemask._y;
flamecontainer.blendmode = "screen";
flamemask._visible = false;
noise_mc.attachbitmap(noiseimage, 1);
var colfilter = new flash.filters.colormatrixfilter([6, 0, 0, 0, -255, 5.500000e+000, 0, 0, 0, -255, 5, 0, 0, 0, -255, 0, 0, 0, 0, 255]);
draweffect();
onenterframe = function ()
{
draweffect();
};
convert candle movieclip, if it's not 1 already. drag instances stage , test.
More discussions in Adobe Animate CC - General
adobe
Comments
Post a Comment