Thanks, Alex! Any suggestion as to how to implement a truly "dynamic" tooltip?
--- In flexcoders@yahoogroups.com, Alex Harui <[EMAIL PROTECTED]> wrote: > > getPosSize gets run once at init time when the width/height isn't known. It doesn't know when to update again > > From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of gwangdesign > Sent: Friday, August 29, 2008 10:20 AM > To: flexcoders@yahoogroups.com > Subject: [flexcoders] dynamic tooltip via function call returns 0 for x/y/width/height > > > Hi, > > I am trying to use tooltip to show x/y/width/height for some of the > UIComponents in my app. But it shows 0 for all these values, while a > similar function call for the click event works fine. Can anyone explain > the reason behind this? > > Here is the code snippet: > > <!--ActionScript--> > [Bindable] > private function getPosSiz(comp:UIComponent):String > { > return comp+"> x: "+comp.x+"; y: "+comp.y+"; w: > "+comp.measuredWidth+"; h: "+comp.height; > } > private function tracePosSiz(comp:UIComponent):void > { > trace(comp+"> x: "+comp.x+"; y: "+comp.y+"; w: "+comp.width+"; h: > "+comp.height); > } > > <!--MXML--> > <mx:Button id="prevBtn" label="<" click="tracePosSiz(prevBtn);" > toolTip="{getPosSiz(prevBtn)}"/> >