デフォルトのターゲットはメインアプリです。したがって、実際には、コンポーネントではなく、state2でアプリ全体の背景を設定しています。これがVBoxの例です
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:states>
<mx:State name="state2">
<mx:SetStyle name="backgroundImage" target="{VBox1}">
<mx:value>
@Embed(source='img2.jpg')
</mx:value>
</mx:SetStyle>
</mx:State>
</mx:states>
<mx:VBox id="VBox1" x="0" y="0" width="50%" height="50%">
<mx:backgroundImage>
@Embed(source='img1.jpg')
</mx:backgroundImage>
</mx:VBox>
</mx:Application>
また、Flex 3 Builderを使用している場合は、いつでもデザインモードに切り替えて、基本状態から新しい状態への変更を確認できます。右上隅にあるはずです。
コンポーネントの編集
メインファイル
<cbsh:BackSwitch>
</cbsh:BackSwitch>
</mx:Application>
成分
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="400" height="300">
<mx:states>
<mx:State name="state2">
<mx:SetStyle name="backgroundImage" target="{this}">
<mx:value>
@Embed(source='img2.jpg')
</mx:value>
</mx:SetStyle>
</mx:State>
</mx:states>
<mx:backgroundImage>
@Embed(source='img1.jpg')
</mx:backgroundImage>
<mx:Button x="437" y="269" label="Switch!" click="currentState='state2';"/>
</mx:VBox>