originaly done for Adobe Flash by External Link converted for use with swishmax 4 by me.
Step.1
Open swishmax 4, for the purpose of this tutorial set your movies width and height as 300 x 200, set the background colour as Solid Black (#000000) and the frame rate to 25 fps.
Step.2
Using the Rectangle Tool (R) 

draw a rectangle width 300 pixels x 200 pixels with a gradient colour fill 

this will make up the flames colour, group the shape as a movieclip and name it gradient_mc
the colours i have used in the gradient are as follows left to right (FFFFCC), (F4D055), (F06B1C), 6F0100)
see the image below.

your rectangle shape once the gradient has been applied should look like the one shown in the image below.

now add the following script to Scene_1 of the movie
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | onFrame (1) { import flash.filters.*; import flash.display.*; var Back_mc = new BitmapData(300, 300, true, 0xFFFFFF); //width & height of rectangle & colour of background you may wish to change gradient_mc.start_offset = [5];// number of pixels to offset change look of fire gradient_mc.finish_offset = [2];// number of pixels to offset change look of fire var c = 0; while (c<4) { gradient_mc.start_offset[c] = {x:0, y:0}; gradient_mc.finish_offset[c] = {x:Math.random()*4-2, y:Math.random()*3+4}; c++; } gradient_mc.onEnterFrame = function() { var c = 0; while (c<4) { this.start_offset[c].x += this.finish_offset[c].x; this.start_offset[c].y += this.finish_offset[c].y; c++; } Back_mc.perlinNoise(16, 50, 3, 5, false, false, 1, true, this.start_offset); var fire = new DisplacementMapFilter(Back_mc, new flash.geom.Point(0, 0), 1, 1, 10, 200, "clamp"); this.filters = [fire]; }; }thats it, press Ctrl+T to see your movie in action, hopefully it will look like the one shown in the example. |
0 التعليقات:
Post a Comment