function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
gtuerkgtuerk 

Changing size of embedded SWF in a VF page

I've got a SWF that's embedded in a VF page.  I've set the layout that houses the VF page to be a one-column layout and the page has nothing but the swf embedded in it.  the swf itself has only a form wrapper around the google map.  Why doesn't the Map extend the width of the screen?

 

 

<apex:page standardController="Location__c" extensions="GoogleMapManager">
<apex:flash id="flexSOs" src="{!$Resource.FlexGoogleMap}"

height="100%" width="100%"

flashvars="session_id={!$Api.Session_ID}&server_url={!$Api.Partner_Server_URL_150}&aLoc={!latitude}&zLoc={!longitude}"/>

</apex:page>

 

 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
creationComplete="init();"
width="100%"
height="100%"
viewSourceURL="srcview/index.html">
<mx:Script>
    <![CDATA[
  
        import com.google.maps.LatLng;
        import com.google.maps.Map;
        import com.google.maps.MapEvent;
        import com.google.maps.MapType;
        import com.google.maps.overlays.Marker;
        import com.google.maps.MapMouseEvent;
        import mx.collections.ArrayCollection;
        import com.google.maps.controls.ScaleControl;
        import com.google.maps.controls.ZoomControl;
        import com.google.maps.controls.MapTypeControl;
       
        [Bindable]
        public var locations:ArrayCollection = new ArrayCollection();
       
        public function init():void{
            Security.allowInsecureDomain("maps.googleapis.com");
        }
       
        private function onMapReady(event:MapEvent):void {
            var lat:Number = parseFloat(parameters.aLoc);
            var lon:Number = parseFloat(parameters.zLoc);
              var latLng:LatLng = new LatLng(lat, lon);
              var marker:Marker = new Marker(latLng);
              map.setCenter(latLng, 17, MapType.NORMAL_MAP_TYPE);
              map.addOverlay(marker);
              map.addControl(new ScaleControl());
              map.addControl(new ZoomControl());
              map.addControl(new MapTypeControl());
        }
    ]]>
    </mx:Script>
        <mx:Form
            width="100%" height="100%"
            borderStyle="solid" borderColor="#D4D4D4"
            dropShadowEnabled="true" dropShadowColor="#B3B3B3"
            shadowDirection="right" shadowDistance="10">
                    <maps:Map xmlns:maps="com.google.maps.*" mapevent_mapready="onMapReady(event)" id="map"
                    key="ABQIAAAAA7aFgeQgFpt9KTUNsnsLOxS_OfvXuFpkKLqWEAhV7rt46ELgZhQqmfKMyH0V6D-GCiomYQVTAEWYSQ"/>
        </mx:Form>       
</mx:Application>

Best Answer chosen by Admin (Salesforce Developers) 
wintamutewintamute
Try it with absolute values (like 800px) instead of percentages. Browser often don't display it correctly, especially when using 100%.

All Answers

wintamutewintamute
Try it with absolute values (like 800px) instead of percentages. Browser often don't display it correctly, especially when using 100%.
This was selected as the best answer
gtuerkgtuerk
Absolute values appear to be required for the height of the embedded page and they should match the layout of the object embedding the VF page.  Wintamute wins a cupie