+1  A: 

You can get the size of your application by doing:

var width:int = Application.application.width;
var height:int = Application.application.height;

With regards to the text disappearing when you hover over the info bubble; you might want to reconsider your approach. Rather than loading an external swf, I have implemented info bubbles for modest maps by adding/removing child objects (like a TextField) to my marker object (which extends Sprite) in response to the appropriate mouse events.

elevine
To clarify, if your swf is disappearing then something external to it might be the issue (like a JavaScript script being loaded into the web page). Can you post the HTML of the page containing your Flex application?
elevine
I'm testing it out here: http://cjbutchershop.com/temp/adtypes/mapTest.swfobviously a work in progress as I haven't formatted my map controls
Phil
The swf disappearing issue is not occurring. What are the steps to reproduce it?
elevine
if you mouseover the POI marker, the bubble appears until you mouseout. If you click the POI marker, the bubble stays on the screen until you either mouse over another marker or click another marker...i want to add a close button but that will come later.click on a POI marker and then move the mouse onto the bubble
Phil
got it! I figured it out. now my only problem is how do i determine the size of the swfobject?
Phil
elevine
My flex application runs the map...but the infobubble that pops up is populated by an external swf file. So that I can properly size my infobubble without hard coding it, i need to be able to get the height and width of the external swf file.
Phil
So you are trying to get the application size from within the info bubble swf? Why is the info bubble in a separate swf? If you have the info bubble source code, I suggest adding it into your map application and directly instantiate the info bubble object.
elevine
A: 

I am new to Flex myself, but i have done something similar while trying out an example while learning. Basically what i suggest is Open the bubble in a new popup window using the PopUpManager class on MouseOver event on the parent window (on your map). And show the popup in a TitleWindow Component,also tap the close event on Title window component.That way you will come back to the same page.Hope this helps.

Posting code here

< ? xml version="1.0" encoding="utf-8" ? >
< mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">

<mx:Script>
    <![CDATA[
     import mx.events.ListEvent;
     import mx.controls.Alert;
     import mx.managers.PopUpManager;
     import mx.rpc.events.ResultEvent;
     import mx.collections.ArrayCollection;

       [Bindable]
       public var photoFeed:ArrayCollection;

     public function searchFlickr():void {
            photoService.cancel();
            var params:Object = new Object();
                params.format = 'rss_200_enc';
                params.tags = srchTxtId.text;         
      photoService.send(params);
     }

     public function resultHandler(event:ResultEvent):void {
      photoFeed = event.result.rss.channel.item as ArrayCollection;
     }

     public function openPanel(levent:ListEvent):void {
      var panelCmpObj:panelcomp = new panelcomp();    
         panelCmpObj.source = levent.itemRenderer.data.content.url;   
      PopUpManager.addPopUp(panelCmpObj,this,true);
     }
        public function test():void {
      Alert.show('testtest');
         }     

    ]]>
</mx:Script>

<mx:HTTPService id="photoService" url="http://api.flickr.com/services/feeds/photos_public.gne" result="resultHandler(event)"/>

<mx:HBox width="362" height="24">
 <mx:TextInput id="srchTxtId"/>
 <mx:Button label="Search for pics" id="srchBtnId" click="searchFlickr()"/>
</mx:HBox>
<mx:TileList id="imgTileList" dataProvider="{photoFeed}" width="100%" height="100%" itemClick="openPanel(event)"> 
<mx:itemRenderer>
    <mx:Component>
      <mx:VBox width="125" height="125"
   paddingBottom="5"
   paddingLeft="5"
   paddingTop="5"
   paddingRight="5">
         <mx:Image width="75" height="75" source="{data.thumbnail.url}"/>
   </mx:VBox>
    </mx:Component>
</mx:itemRenderer>
</mx:TileList>

CODE FOR THE COMPONENT shown on PopUP
< ? xml version="1.0" encoding="utf-8" ? >
< mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" showCloseButton="true" styleName="noPadding" creationComplete="init();" close="titleWindow_close(event);" >
< ![CDATA[ import mx.managers.IFocusManagerComponent; import mx.controls.Alert; import mx.core.IFlexDisplayObject; import mx.events.CloseEvent; import mx.managers.PopUpManager;

        [Bindable]
        public var source:String;

        private function init():void {
            PopUpManager.centerPopUp(this);
        }

        private function titleWindow_close(evt:CloseEvent):void {
            PopUpManager.removePopUp(evt.target as IFlexDisplayObject);
        }
    ]] >
< /mx:Script>

< mx:Image width="379" height="261" id="imgId" source="{source}"/>
   <mx:ControlBar horizontalAlign="right" width="100%">
</ mx:ControlBar>

< /mx:TitleWindow >

Rajat
A: 

"So you are trying to get the application size from within the info bubble swf? Why is the info bubble in a separate swf? If you have the info bubble source code, I suggest adding it into your map application and directly instantiate the info bubble object. – elevine 2 hours ago"

I have three different type of infoBubbles (only static bubble is shown). Some of my info bubbles have moving content. I am not looking for the application size of the external swf in the bubble, i am looking for the physical size. The height and width of the external swf that is populating the bubble. If I knew the height and width, I can have the infobubble match the height and width. Right now I have the info bubble hardcoded to the size of the current info bubble; however, i will have different sizes of info bubbles swf files.

Phil