Flag effect in ActionScript 3

What better image to use for a flag effect than an image by Derek Riggs (which you already have on your living room wall right? Not?)

Click on the flag !

Anyway, in this example I’ve experimented with using perlin noise as a displacementmap, and overlaying the same displacement map for a lighting effect. The lighting effect was tweaked using a colortransform, and the falloff on the flag (the right side is much more affected by the wind than the left side) was realized by mixing the perlinnoise map with a gradient.Here is the complete example with sourcecode included: [Download not found]. Note that Example1.as to Example4.as should be run from the flashdevelop project nummero uno, while this example (example5) should be run from project nummero duo. Example 1 – 4 just experiment with the basics, and the last example puts it all together with documentation.

Download sources: [Download not found]

3 replies
    • Hans Wichman
      Hans Wichman says:

      Hi Michael,

      yeah probably, you might have to apply a mask to the layer that is used for the lights, but technically it shouldnt be a problem. Question is though that with the new flash player if you still need to fake this effect using displacement maps, or if you should just create a mesh with a light on it in away3d or alternativa (or on your own, although how is beyond me:)).



Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *