給大家的好日子!將選定的項目從DataGroup(數據提供者是XML列表)綁定到另一個組件(FLEX 4)
我有一個DataGroup,它具有從XML列表傳遞給ArrayCollection的縮略圖。我也有一個數據組的自定義項目渲染器。我做不到的工作如下:當數據組中的縮略圖被點擊時,狀態改變爲帶有關於項目信息的頁面。
我有相同的XML文件中的信息。我需要將richtext和多個標籤組件的源代碼綁定到數據組中的選定項目,並使用XML列表中項目的不同屬性。它它是一個簡單的列表組件,我會做下列方式: 的名單
ID =「myList中」的dataProvider =「{} myProjects.Project」 爲標籤 文本=「{ myList.selectedItem.textexample}」
我對DATAGROUP代碼:
<s:DataGroup includeIn="ThumbnailList" dataProvider="{myList}" alpha="0.72"
blendMode="luminosity" buttonMode="true" id="myThumbs"
clipAndEnableScrolling="true" height="187"
itemRenderer="components.CustomRenderer4Thumbs"
d:userLabel="hos_RepeatedItem" width="320" x="110" y="2" />
渲染器的代碼:
<fx:Script>
<![CDATA[
[Bindable] public var counter:Number=0;
protected function image1_clickHandler(event:MouseEvent):void
{
if(counter==0)
{
this.currentState="selected";
moveIn.play([offsets]);
counter=1;
}
else if(counter==1)
{
mx.core.FlexGlobals.topLevelApplication.currentState="DescriptionPagefromThumbs";
counter=0;
}
}
]]>
</fx:Script>
<fx:Declarations>
<s:Animate id="Larger" duration="250">
<s:motionPaths>
<s:SimpleMotionPath property="height" valueFrom="50" valueTo="100" />
<s:SimpleMotionPath property="width" valueFrom="50" valueTo="100" />
</s:motionPaths>
</s:Animate>
<s:Animate id="moveIn" target="{offsets}" duration="650">
<s:SimpleMotionPath property="scaleX" />
<s:SimpleMotionPath property="scaleY" />
<s:SimpleMotionPath property="x" />
<s:SimpleMotionPath property="y" />
</s:Animate>
</fx:Declarations>
<s:states>
<s:State name="normal"/>
<s:State name="hovered"/>
<s:State name="selected"/>
</s:states>
<mx:Image height.hovered="50" click="image1_clickHandler(event)" id="image1" maintainAspectRatio="true" smoothBitmapContent="true" source="{data.Thumb}" d:userLabel="hos_RepeatedItemTH" width.hovered="50" x="0" y="0"/>
XML列表中包含至少有標題,Thumb和textexample每個項目。
我將不勝感激任何幫助!