Yes, I used the default contentHTML container.
You can see below the code I used , the title and content are loaded
trhough an xml-file.

[AS3]
var html:String = "<b>" + myTitle + "</b>" + myContent + "<br/>"+
myUrl;
var options:InfoWindowOptions = new InfoWindowOptions({
        contentHTML: html,
        pointOffset: new Point(10, -25)
});
[/AS3]

I also tried the customContent container by calling an external class
that has a content and the design of the 'new'  tooltip, code below:

Calling the the external class InfoWindowSprite:
[AS3]
var options:InfoWindowOptions = new InfoWindowOptions({
        customContent: new InfoWindowSprite(tip, myTitle, myContent, myUrl),
        customOffset: new Point(-30, 0)
        customCloseRect: new Rectangle(65, -180, 20, 20)
});
i.addEventListener(MapMouseEvent.CLICK, function
(event:MapMouseEvent):void
{
map.openInfoWindow(event.latLng, options);
});
return i;
[/AS3]

External class InfoWindowSprite.as the whole code.

[AS3]
package {

        import flash.display.MovieClip;
        import flash.display.Sprite;
        import flash.events.MouseEvent;
        import flash.text.TextField;
        import flash.text.TextFormat;
        import flash.events.*;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
        import flash.xml.*;


        /**
         * InfoWindowSprite is a sprite that contains sub sprites that
function as tabs.
         */

        public class InfoWindowSprite extends Sprite {

                public var bodyTextField:TextField;

                public function InfoWindowSprite(tip, myTitle, myContent, 
myUrl) {
                        // Create info window frame

                        graphics.lineStyle(2, 0x000000, 1, true);
                        graphics.beginFill(0xEEEEEE);
                        graphics.drawRoundRect(-75, -180, 170, 50, 20);
                        var pointer:MovieClip = new myPointer();
                        pointer.x = -7;
                        pointer.y = -17;
                        addChild(pointer);

                        // Create 'X' close button
                        var xClose:MovieClip = new bClose;
                        xClose.y = -170;
                        xClose.x = 75;
                        addChild(xClose);

                        // Create body text
                        bodyTextField = new TextField();
                        bodyTextField.x = -70;
                        bodyTextField.y = -140;
                        bodyTextField.width = 150;
                        bodyTextField.wordWrap = true;
                        bodyTextField.multiline = true;
                        bodyTextField.htmlText = ""+myContent " "<br/>""+myUrl;
                        bodyTextField.selectable = false;
                        bodyTextField.border = true;
                        addChild(bodyTextField);

                        cacheAsBitmap = true;
                }


        }

}
[/AS3]

The problem with calling the external class is that the tooltip is not
scaling with the content at all. It's hard to explain but I hope you
can follow.
The tooltip has a fixed size.
[AS3]
        graphics.lineStyle(2, 0x000000, 1, true);
        graphics.beginFill(0xEEEEEE);
        graphics.drawRoundRect(-75, -180, 170, 50, 20);
[/AS3]
Then I create a htmlTextField for where I can put my text and image
and url from my xml file.
[AS3]
bodyTextField = new TextField();
bodyTextField.x = -70;
bodyTextField.y = -140;
bodyTextField.width = 150;
bodyTextField.wordWrap = true;
bodyTextField.multiline = true;
bodyTextField.htmlText = ""+myContent " <br/>"+myUrl;
bodyTextField.selectable = false;
bodyTextField.border = true;
addChild(bodyTextField);
[/AS3]

I thought to change the size of the tooltip is to change the settings
of the bodyTextField options. But i do not know for sure.

That is why I returned to the default contentHTML container because
this one scales with the textfield size but only in the height not in
width.

Hopefully you can help me with this.

I will wait for your reply

Thanx,

Roy

--

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