Hi,

After the long subject header...

I have a googleMaps app, which uses markers, infoWindows and
customContent.

The customContent is an AS3 class, and it works great....except when I
want to use the
textField.htmlText.

my as3 class looks like:

/*
* Copyright 2008 Google Inc.
* Licensed under the Apache License, Version 2.0:
*  http://www.apache.org/licenses/LICENSE-2.0
*/
package classes {

import flash.display.Sprite;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.TextFormat;

import mx.controls.Text;


/**
 * Display info window - use a navy blue rectangle
 * in it insert title, text, and htmlText
 */

public class InfoWindowSprite extends Sprite {

        public function InfoWindowSprite() {
          // Draw info window frame

           var infobox:Sprite = new Sprite();
           // draw rectangle
            infobox.graphics.lineStyle(2, 0xc2deea, 1, true);
            infobox.graphics.beginFill(0x223344);
            infobox.graphics.drawRoundRect(-75, -110, 440, 161, 10, 10);

            // Draw close area rect
            var xbox:Sprite = new Sprite();
            xbox.graphics.beginFill(0xc2deea);
            xbox.graphics.drawRoundRect(330, -105, 30, 30,5);
            xbox.graphics.endFill();
            // Add close 'X'
            var xTextFormat:TextFormat = new TextFormat();
            xTextFormat.font = "Verdana";
            xTextFormat.color = 0xFEFEFE;
            xTextFormat.size = 21;
            xTextFormat.bold = true;

            var xText:TextField = new TextField();
            xText.x = 335;
            xText.y = -105;
            xText.text = "X";
            xText.setTextFormat(xTextFormat);

             // Add title text
            var titleTextFormat:TextFormat = new TextFormat();
            titleTextFormat.font = "Verdana";
            titleTextFormat.color = 0xFEFEFE;
            titleTextFormat.size = 20;
            titleTextFormat.align = "left";

            var titleTextField:TextField = new TextField();
            titleTextField.x = -70;
            titleTextField.y = -110;
            titleTextField.width = 300;
            titleTextField.text = "This is the title";
            titleTextField.selectable = false;
            titleTextField.setTextFormat(titleTextFormat);

            // link
            var urlTextField:TextField = new TextField();
            urlTextField.x = -70;
            urlTextField.y = 20;
            urlTextField.width = 200;
            urlTextField.height = 100;
            urlTextField.autoSize = TextFieldAutoSize.LEFT;
            urlTextField.htmlText = "<a>";
            urlTextField.htmlText+="http://www.google.com";;
            urlTextField.htmlText+="</a>";
            urlTextField.setTextFormat(titleTextFormat);

            infobox.addChild(titleTextField);
            infobox.addChild(urlTextField);
            infobox.x = 50;
                    infobox.y = 50;
                   addChild(infobox)
           cacheAsBitmap = true;
        } // end function

     } // end class

} // end package


My mxml is as the sample example, the call to the infoWindow looks
like:

var marker:Marker = new Marker(latlng, markerOptions);

       infoSprite = new InfoWindowSprite(pinXMLInfo);

      var options:InfoWindowOptions = new InfoWindowOptions({
      customContent: infoSprite,
        /* customOffset: new Point(50, 50), */
                                customCloseRect: new Rectangle(400, 0, 30, 30)
                        });
                        marker.addEventListener(MapMouseEvent.CLICK, function
(e:Event):void {
                        marker.openInfoWindow(options);
                });
                map.addOverlay(marker);

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