Sunday, May 23, 2010

GraphicGroup

Probably the most common hack I've had to perpetrate in Flex 4 has had do with creating backgrounds for groups. Obviously Adobe wanted to keep the Group class lightweight, but denying fill/stroke capabilities seems silly considering the graphics object is already there- we just need methods to access it.

Here's GraphicGroup- an extension of Group that exposes Stroke/Fill properties just like a Rect, and alternately exposes some convenient style properties. The same code can be added to HGroup and VGroup.

GraphicGroup.as

No comments:

Post a Comment

Comments...