I have a panel and I load an image in at runtime, I would like to position the label directly underneath the image which may have different heights, Can I use the contentHeight of the image to position the label? does the panel need to be refreshed? or is there another layout tool that does this better? I'd like to position textArea 'txComment' directly underneath image 'fullImage' thanks! here's my code:
<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:comp="components.*" creationComplete="init()" height="727"> <mx:Script> <![CDATA[ import mx.utils.ArrayUtil import mx.rpc.events.*; import mx.collections.*; [Bindable] public var members:ArrayCollection; private function init():void { memberDataIn.send(); } private function memberHandler (event:ResultEvent):void { members = event.result.members.member; } [Bindable] public var selectedmember:Object; [Bindable] public var selectedusername:Object; [Bindable] public var selecteduserid:Object; [Bindable] public var selectedfname:Object; [Bindable] public var selectedlname:Object; [Bindable] public var selectedlastvisit:Object; [Bindable] public var selectedpicture:Object; [Bindable] public var selectedtitle:Object; [Bindable] public var selectedcomment:Object; [Bindable] public var selectedlocation:Object; [Bindable] public var selectedstate:Object; [Bindable] public var selectedage:Object; private function displayMemberDetails (event:Event):void { //currentstate ='memberdetails'; selectedmember = new Object(); selectedmember = event.currentTarget.selectedItem; fullImage.load ('http://www.yourasianconnection.com/members/' + selectedmember.picture); selectedusername = selectedmember.username; selecteduserid = selectedmember.userid; selectedfname = selectedmember.fname; selectedlname = selectedmember.lname; selectedlastvisit = selectedmember.lastvisit; selectedtitle = selectedmember.title; selectedcomment = selectedmember.comment; selectedlocation = selectedmember.location; selectedstate = selectedmember.state; selectedage = selectedmember.age; } ]]> </mx:Script> <mx:HTTPService id="memberDataIn" url="assets/female180.xml" result="memberHandler(event)" /> <mx:Canvas y="25" right="66" left="-171" backgroundColor="#80ffff"> <mx:TileList x="10" y="10" id="tlUsers" dataProvider="{members}" rowHeight="140" columnWidth="80" labelField="{data.username}" change="displayMemberDetails(event)" percentWidth="50" itemRenderer="components.pnThumb" ></mx:TileList> <mx:Panel x="561" y="0" width="550" height="600" layout="absolute" id="userdetail"> <mx:Text x="10" y="10" text="{selectedusername}" id="txUsername" fontSize="12" fontWeight="bold"/> <mx:Label x="161" y="12" text="{selectedtitle}" fontSize="12"/> <mx:Image x="10" y="31" width="400" height="400" id="fullImage"/> <mx:TextArea x="10" y="{fullImage.contentHeight}" width="365" height="200" editable="false" wordWrap="true" text="{selectedcomment}" id="txComment"/> </mx:Panel> </mx:Canvas> </mx:Application>

