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
-~----------~----~----~----~------~----~------~--~---

Reply via email to