hi all,
i'm working on a google map as3 pure project and I've an issue with
stage and resize. It's all ok my map is displayed well, the size of
the map is 800 x 600 and ceneter on the scree, but when I try to
resize the browser the size of the map change and of course it's
position. Why? It's me or what?. I look into the documentation but i
can not find anything that can help me.  Thanks.

output trace (reads: stage width stage height map width map height map
x map y):

1285 846 801 601 242 122.5
1283 844 1279.95 1279.95 1.5 -217.95
1272 837 1279.95 1279.95 -3.95 -221.45


code:

package
{
        import com.qubozone.flash.map.MapRequest;

        import flash.display.Sprite;
        import flash.display.StageAlign;
        import flash.display.StageScaleMode;
        import flash.events.Event;

        public class GoogleMapWrapper extends Sprite
        {
                private var _mapRequest:MapRequest;

                public function GoogleMapWrapper()
                {
                        initStage();
                        initMap();
                }

                private function initStage():void
                {
                        stage.align = StageAlign.TOP_LEFT;
                        stage.scaleMode = StageScaleMode.NO_SCALE;
                        stage.addEventListener(Event.RESIZE, onStageResize);
                }

                private function initMap():void
                {
                        _mapRequest = new MapRequest("map.xml");
                        _mapRequest.addEventListener(Event.COMPLETE, 
onMapRequestComplete);
                        addChild(_mapRequest);
                }

                private function onMapRequestComplete(e:Event):void
                {
                        align();
                        _mapRequest.removeEventListener(Event.COMPLETE,
onMapRequestComplete);
                }

                private function onStageResize(e:Event):void
                {
                        align();
                }

                private function align():void
                {
                        _mapRequest.x = (stage.stageWidth - _mapRequest.width) 
* 0.5;
                        _mapRequest.y = (stage.stageHeight - 
_mapRequest.height) * 0.5;
                }
        }
}
--~--~---------~--~----~------------~-------~--~----~
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