干得好 -
资产/图标/FB.png:
资产/图标/GG.png:
意见/Home.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark">
<fx:Script>
<![CDATA[
import mx.core.BitmapAsset;
import mx.events.FlexEvent;
import spark.components.SplitViewNavigator;
import spark.components.ViewNavigator;
import spark.core.SpriteVisualElement;
import spark.events.IndexChangeEvent;
[Embed(source="assets/icons/FB.png")]
private static const FB_CLASS:Class;
[Embed(source="assets/icons/GG.png")]
private static const GG_CLASS:Class;
private static const FB_ICON:BitmapAsset = new FB_CLASS() as BitmapAsset;
private static const GG_ICON:BitmapAsset = new GG_CLASS() as BitmapAsset;
protected function handleChange(event:IndexChangeEvent):void {
var item:Object = login.selectedItem;
navigator.pushView(item.view, item.str);
}
]]>
</fx:Script>
<s:List width="100%" height="100%" id="login" change="handleChange(event);">
<s:dataProvider>
<s:ArrayCollection>
<fx:Object icon="{FB_ICON}" view="{FB}" label="Play at" msg="Facebook.com" />
<fx:Object icon="{GG_ICON}" view="{GG}" label="Play at" msg="Google+" />
</s:ArrayCollection>
</s:dataProvider>
<s:itemRenderer>
<fx:Component>
<s:IconItemRenderer labelField="label" iconField="icon" messageField="msg"/>
</fx:Component>
</s:itemRenderer>
</s:List>
</s:View>
应用程序.mxml:
<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
firstView="views.Home">
</s:ViewNavigatorApplication>
上面引用的views/FB.mxml和views/GG.mxml - 由您自己创建;-)