Created
June 4, 2010 03:00
-
-
Save aerith/424873 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<mx:VBox width="100%" height="100%"> | |
<mx:Repeater id="rp" startingIndex="0" recycleChildren="false"> | |
<flexlibContainer:WindowShade id="windowShade" width="100%" data="{rp.currentItem}" opened="false"> | |
<flexlibContainer:headerRenderer> | |
<mx:Component> | |
<flexlibControl:CanvasButton | |
xmlns:mx="http://www.adobe.com/2006/mxml" | |
width="100%" | |
creationComplete="creationCompleteHandler(event)" | |
click="headerClickHandler(event)" | |
> | |
<mx:Script> | |
<![CDATA[ | |
import flexlib.containers.WindowShade; | |
import mx.controls.Alert; | |
[Bindable] public var parentComponent:WindowShade ; | |
private function creationCompleteHandler(event:Event):void { | |
parentComponent = WindowShade(parent); | |
} | |
private function headerClickHandler(event:Event):void | |
{ | |
if (parentComponent.data) { | |
for (var i:uint = 0; i < outerDocument.windowShade.length; i++) { | |
var shade:WindowShade = outerDocument.windowShade[i]; | |
if (shade == event.currentTarget.parentComponent) { | |
setStyle('fontWeight',"normal"); | |
icon.visible = icon.includeInLayout = false; | |
shade.data.isNew = false; | |
shade.data.isRead = true; | |
outerDocument.rp.dataProvider.itemUpdated(shade.data); | |
Alert.show("setStyle"); | |
} | |
} | |
} | |
} | |
]]> | |
</mx:Script> | |
<mx:HBox width="100%"> | |
<mx:Image id="icon" source="{outerDocument.newIcon}" visible="{parentComponent.data.isNew}" includeInLayout="{parentComponent.data.isNew}"/> | |
<mx:Label text="{parentComponent.data.label}" /> | |
</mx:HBox> | |
</flexlibControl:CanvasButton> | |
</mx:Component> | |
</flexlibContainer:headerRenderer> | |
<mx:VBox width="100%" height="100%"> | |
<mx:Label text=" {rp.currentItem.userName}"/> | |
<mx:Label text="{rp.currentItem.posted}"/> | |
<mx:Text width="100%" text="{rp.currentItem.body}"/> | |
</mx:VBox> | |
</flexlibContainer:WindowShade> | |
</mx:Repeater> | |
</mx:VBox> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment