Visual Reflections in ActionScript 2

Making a reflection is not that hard, but getting it to work right with scaled clips with weird registration points out of the box was a little harder. Anyway I think I came up with something nice, and it performs quite well:

You can download the source and a bunch of demo’s here Reflection Demos (2627 downloads) .

Here is a list of features:

  • simple setup by default. In most cases doing new ReflectionManager (sourceClip) will suffice
  • default setup is a clip that fades from 40 to 0 alpha at 40% of the image
  • you can change the falloff height, overall alpha, and the redraw interval (eg to mirror video)
  • retrievable reflection and source clips to apply filters or otherwise control clips
  • redraw interval is disconnected from framerate, specify a low redraw interval to save system resources
  • works with scaled, non top left regpoints, and masked clip, using an autobounds detection algorithm
  • works with negative scaled clips
  • tries to warn you in most cases when the result is likely to be different from what you expect
  • very high performance
  • no dependencies on non flash classes

A couple of screenshots of the other demo’s:
Difference process

Print Friendly, PDF & Email
1 reply

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 *