[flexcoders] going crazy: custom tooltip positioning
I honestly honestly don't get why I'm having problems positioning this thing; I can set the alpha but can NEVER set the position -- in this example I'm trying to set it to 0,0 (and then moving it to -100,-100) just to see SOMETHING happen - but it never does: Just so you understand as well - I created my own event so that I could get a proper bubble up from an itemrenderer in a list - (ie a slideshow thumbnail). I want to pop over a larger image of this slideshow (hence the class SlidePreviewPopup) - and am passing the original toolTipEvent along. var spp:SlidePreviewPopup = new SlidePreviewPopup(); spp.image.source = event.item.thumbnail; var pt:Point = new Point(event.toolTipEvent.currentTarget.x, event.toolTipEvent.currentTarget.y); var npt:Point = event.toolTipEvent.currentTarget.contentToGlobal(pt); spp.x = 0; spp.y= 0; spp.alpha = .5; event.toolTipEvent.toolTip = spp; trace(spp.x + ' ' + spp.y); spp.move(-100,-100); trace(spp.x + ' '+ spp.y); I'm starting to think that perhaps I *should* do a popup rather than a tooltip...wondering if that will be able to be positioned - but why can't I, for the sake of argument GET this damn tooltip to position? Garry Schafer grimmwerks gr...@grimmwerks.com portfolio: www.grimmwerks.com/
[flexcoders] going crazy: custom tooltip positioning
I honestly honestly don't get why I'm having problems positioning this thing; I can set the alpha but can NEVER set the position -- in this example I'm trying to set it to 0,0 (and then moving it to -100,-100) just to see SOMETHING happen - but it never does: Just so you understand as well - I created my own event so that I could get a proper bubble up from an itemrenderer in a list - (ie a slideshow thumbnail). I want to pop over a larger image of this slideshow (hence the class SlidePreviewPopup) - and am passing the original toolTipEvent along. var spp:SlidePreviewPopup = new SlidePreviewPopup(); spp.image.source = event.item.thumbnail; var pt:Point = new Point(event.toolTipEvent.currentTarget.x, event.toolTipEvent.currentTarget.y); var npt:Point = event.toolTipEvent.currentTarget.contentToGlobal(pt); spp.x = 0; spp.y= 0; spp.alpha = .5; event.toolTipEvent.toolTip = spp; trace(spp.x + ' ' + spp.y); spp.move(-100,-100); trace(spp.x + ' '+ spp.y); I'm starting to think that perhaps I *should* do a popup rather t han a tooltip...wondering if that will be able to be positioned - but why can't I, for the sake of argument GET this tooltip to position? (got a profanity warning?) Garry Schafer grimmwerks gr...@grimmwerks.com portfolio: www.grimmwerks.com/
Re: [flexcoders] going crazy: custom tooltip positioning
What event are you grabbing? Look at how datatips are handled in DG itemrenderers. Remember that a tooltip goes away on rollout, are you sure that’s what you want? On 7/24/12 7:24 AM, grimmwerks gr...@grimmwerks.com wrote: I honestly honestly don't get why I'm having problems positioning this thing; I can set the alpha but can NEVER set the position -- in this example I'm trying to set it to 0,0 (and then moving it to -100,-100) just to see SOMETHING happen - but it never does: Just so you understand as well - I created my own event so that I could get a proper bubble up from an itemrenderer in a list - (ie a slideshow thumbnail). I want to pop over a larger image of this slideshow (hence the class SlidePreviewPopup) - and am passing the original toolTipEvent along. var spp:SlidePreviewPopup = new SlidePreviewPopup(); spp.image.source = event.item.thumbnail; var pt:Point = ! new Point(event.toolTipEvent.currentTarget.x, event.toolTipEvent.currentTarget.y); var npt:Point = event.toolTipEvent.currentTarget.contentToGlobal(pt); spp.x = 0; spp.y= 0; spp.alpha = .5; event.toolTipEvent.toolTip = spp; trace(spp.x + ' ' + spp.y); spp.move(-100,-100); trace(spp.x + ' '+ ! spp.y); I'm sta rting to think that perhaps I *should* do a popup rather t han a tooltip...wondering if that will be able to be positioned - but why can't I, for the sake of argument GET this tooltip to position? (got a profanity warning?) Garry Schafer grimmwerks gr...@grimmwerks.com portfolio: www.grimmwerks.com/ http://www.grimmwerks.com/ -- Alex Harui Flex SDK Team Adobe Systems, Inc. http://blogs.adobe.com/aharui