I found that you can actually use HTML text in the tooltip so you can add with img. But this very limited and not customizable at all : ( pity, those default tooltips look very old.
I am using this trick for polygon tooltips but I suppose it will also work on markers. Ahh. There is a trick to make it work on flash9 (in 10 does not happen) on the img tag don't forget to add and Id parameter that is unique (I use the srcas Id too as this is unique in my case). If you don't youn will get errors after hovering over the second marker. Javier www.vizzuality.com On 02/02/2009, at 22:07, "[email protected]" <[email protected]> wrote: > > Is it possible to have images in a marker tooltip without resorting to > adding extra event listeners? > > I created a custom tooltip component, but there doesn't appear to be > anyway to link it to a marker created in Actionscript. It seems that > the marker class lacks the "toolTipCreate" method as many Actionscipt > components have. Is there any workaround or other ways to include an > image in the marker tooltip? > > Here is my custom tooltip component code: > <?xml version="1.0"?> > <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" > implements="mx.core.IToolTip" > backgroundColor="0xCCCCCC" > borderColor="black" > borderStyle="solid" > horizontalScrollPolicy="off" > verticalScrollPolicy="off" > horizontalAlign="center"> > > <mx:Text text="{bodyText}" /> > <mx:Image source="{bodyPic}" /> > > <mx:Script><![CDATA[ > import mx.controls.Image; > [Bindable] public var bodyText:String = ""; > [Bindable] public var bodyPic:Image; > > // Required methods of the IToolTip interface: > public var _text:String; > public function get text():String { return _text; } > public function set text(value:String):void { } > ]]></mx:Script> > </mx:VBox> > > Normally you would link the custom tooltip to a component such as a > button like this; > > <?xml version="1.0"?> > <!-- tooltips/MainCustomApp.mxml --> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> > <mx:Script><![CDATA[ > import mx.controls.Image; > import CustomToolTips.lynxToolTip; > import mx.events.ToolTipEvent; > > private function createCustomTip( txt:String, > img:Image,event:ToolTipEvent):void { > var myTT:lynxToolTip = new lynxToolTip(); > event.toolTip = myTT; > myTT.bodyText = txt; > myTT.bodyPic=img; > } > > ]]></mx:Script> > > <mx:Button id="b1" > label="testButton" > toolTip=" " > toolTipCreate="createCustomTip('tooltip test',test,event)" > /> > <mx:Image id="test" width="236" height="116" source="somePic.jpg"/ >> > > </mx:Application> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en -~----------~----~----~----~------~----~------~--~---
