Use SpriteVisualElement to implement a simple component in Flex 4
September 29, 2010. Posted by Andy Hulstkamp in Actionscript 3, flex 4. 3 Comments »
Keywords: custom component, flash sprite, layout pass, SpriteVisualElement
Keywords: custom component, flash sprite, layout pass, SpriteVisualElement
In Flex 4 the standard way to create a custom control is to extend from SkinnableComponent, then implement the handling and management of events and states there and use a separate skin class for the visual representation of the component.
A class that gets less attention, but might be useful in a couple of scenarios to create a control alternatively, is the SpriteVisualElement class.
This example shows an implementation of a simple ruler by extending the SpriteVisualElement.
The SpriteVisualElement
The SpriteVisualElement is a display object that can be used inside spark containers.
It inherits from Sprite and implements the (more…)
