Search code examples
actionscript-3flash-cs4

AS3 DropShadowFilter() with a 3D instance


I have an instance on stage that has a DropShadowFilter() added by code, when I change rotationXor rotationY of that instance, the angle of DropShadowFilter() goes crazy, so my question

How can I make the angle of the DropShadowFilter() fixed while altering the 3D properties of an instance?


Solution

  • A sprite wrapper should do. You wrap your instance in a Sprite, add a new DropShadowFilter() to the instance, and change rotationX or rotationY on the wrapper sprite. This way the filter will continue to operate in a 2D space and will retain correctness, while the complete object will be rotated in 3D via wrapper.