This Thematic widget for the ArcGIS Viewer for Flex will allow you to easily create a dynamic thematic layer for your application.