Flash burning fire (flame effect with pure actionscript)
JUST 613 bytes in swf |
- Open Flash 8,
- make new flash movie,
- insert the code below in actions for first frame (select frame, press F9, copy-paste code to the Actions pane)
- make rectangle with linear gradient fill, convert it to movieclip symbol (select and F8)
- having your new movieclip selected, press Ctrl+F3 to view it's properties
- type gradient_mc in "Instance name" field
- Hit Ctrl+Enter to see it
import flash.filters.*; import flash.display.*; // var my_btm = new BitmapData(200, 200, true, 0xFFFFFF); gradient_mc.start_offset = []; gradient_mc.finish_offset = []; var c = 0; while (c<3) { 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<3) { this.start_offset[c].x += this.finish_offset[c].x; this.start_offset[c].y += this.finish_offset[c].y; c++; } // my_btm.perlinNoise(15, 50, 3, 5, false, false, 1, true, this.start_offset); var dmf = new DisplacementMapFilter(my_btm, new flash.geom.Point(0, 0), 1, 1, 10, 200, "clamp"); this.filters = [dmf]; };
Copyrights and thanks to Kuzen
Related Posts by Categories
11:20 PM
|
|
This entry was posted on 11:20 PM
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
Subscribe to:
Post Comments (Atom)
4 comments:
Hmm...
please check this one (borealis fire):
http://itoa.terror404.net/flash/index.html
How about an embedded example of this in action?
Very similar approach to one I created a while ago.
http://blog.audiotheory.co.uk/
Also check out http://www.pickatutorial.com for Flash and / or Actionscript tutorials.
Post a Comment