How would I display a backgroundImage on a List when the List is empty?
At the moment the list is populated when items are dropped inside after a drag-and-drop but I would prefer a solution that checks for any change to the data to determine if the list is empty.
The List inherits a backgroundImage from its ScrollControlBase but what would be the best way to make it appear when the list is empty and disappear when an item is added.
Any suggestions?
Thanks!
In the past, I’ve done it with states for a component. Quick and dirty example would be something like this in your custom component:
<mx:List currentState='{(listItemsDataProvider.length > 0) ? 'HasItemsState' : 'NoItemsState'}'>// anything else you need</mx:List>and of course creating those states in the component, with the NoItemsStates changing the background image, or if your component is a container, like a
Canvas, then you can have the state not display theListat all.