我有一个从 XML 接收数据的文本框。已激活服务。如果我在 {} 中使用“taurus”而不是 myVar,一切正常。现在我想更改字段并根据按下的按钮接收不同的数据。但是什么都没有出来。
public var myVar:String = "taurus";
protected function t1_creationCompleteHandler(event:FlexEvent):void
{
getDataResult.token = lov.getData();
}
protected function b1_clickHandler(event:MouseEvent):void
{
var myVar:String = "aries";
getDataResult.token = lov.getData();
}
]]>
</fx:Script>
<fx:Declarations>
<s:CallResponder id="getDataResult"/>
<lov:Lov id="lov" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
</fx:Declarations>
<s:TextArea x="10" y="146" width="179" height="89" id="t1" text="{getDataResult.lastResult.myVar.yesterday}"/>
<s:TextArea x="10" y="257" width="179" height="89" id="t2" text="{getDataResult.lastResult.taurus.today}"/>
<s:Button x="10" y="27" label="Aries" id="b1" click="b1_clickHandler(event)"/>