此 flashbuilder 4.6 应用程序根据从下拉列表中选择的名称在折线图上显示单个 lineSeries,并且lineseries 数据显示良好。但是,工具提示显示 [object Playername_returntype] 而不是下拉选择的名称。
我还想从下拉列表中动态地将相同的选择名称分配给 lineeries 的 displayName,但无法实现这一点。结果显示 [object Playername_returntype],如工具提示中所示。
任何帮助将非常感激。
谢谢。
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:pool_ratings_yr1service="services.pool_ratings_yr1service.*"
xmlns:pool_playerservice="services.pool_playerservice.*"
minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
protected function linechart1_creationCompleteHandler(event:FlexEvent):void
{
getpool_ratings_yr1Result.token = pool_ratings_yr1Service.getpool_ratings_yr1('Greenleaf');
}
protected function dropDownList_creationCompleteHandler(event:FlexEvent):void
{
getAllpool_playerResult.token = pool_playerService.getAllpool_player();
}
private function comboBoxChange():void
{
var selectedName:String = dropDownList.selectedItem.lname;
getpool_ratings_yr1Result.token = pool_ratings_yr1Service.getpool_ratings_yr1(selectedName);
}
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getpool_ratings_yr1Result"/>
<pool_ratings_yr1service:Pool_ratings_yr1Service id="pool_ratings_yr1Service"
fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
showBusyCursor="true"/>
<s:CallResponder id="getAllpool_ratings_yr1Result"/>
<s:CallResponder id="getAllpool_playerResult"/>
<pool_playerservice:Pool_playerService id="pool_playerService"
fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
showBusyCursor="true"/>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<mx:LineChart id="linechart1" x="151" y="88" width="800"
creationComplete="linechart1_creationCompleteHandler(event)"
dataProvider="{getpool_ratings_yr1Result.lastResult}" showDataTips="true">
<mx:verticalAxis>
<mx:LinearAxis id="v1" minimum="2000" maximum="2500" title="Average Elo Rating" />
</mx:verticalAxis>
<mx:series>
<mx:LineSeries id="lineSeries" displayName="{dropDownList.selectedItem}" yField="avg_rating"/>
</mx:series>
<mx:horizontalAxis>
<mx:CategoryAxis id="categoryAxis" categoryField="yr"/>
</mx:horizontalAxis>
</mx:LineChart>
<mx:Legend dataProvider="{linechart1}"/>
<s:DropDownList id="dropDownList" x="10" y="88"
creationComplete="dropDownList_creationCompleteHandler(event)"
labelField="lname"
change="comboBoxChange()">
<s:AsyncListView list="{getAllpool_playerResult.lastResult}"/>
</s:DropDownList>