Gustavo: Sorry, but I don't think the approach you are taking is necessarily advisable, or even technically correct (in one regard). Specifically:
1) screen.width (and screen.height, and screen.availableWidth, etc.) allow JavaScript (DOM) code to discover the size of the user's monitor (screen hardware), not of the browser window in which your Flex application is running. (The available* properties then subtract from that size any operating system 'reserved' screen real estate, such as the Windows task bar.) 2) I would be very surprised if JavaScript code could alter the value of any of these properties--by definition they could not be under the control of a browser window, so they should be read-only. Therefore, code like screen.width = 1024; should not be expected to work. Even if that code _does_ happen to work with one Browser or Operating System, I wouldn't rely on it! 3) A reasonably reliable way to ensure that your application is running in a browser window of the size that you want, is to use the JavaScript/browser DOM Window.open() method to open a new window, which gives you the opportunity to specify the size of browser window that you want your application to have. Be sure to note that you are specifying the overall (e.g., outer) size of the window; you are NOT specifying how much (client) area that your application will get. *** Different brands (and versions) of browsers will use different amounts of space for their own 'chrome' (UI elements such as the URL/address bar, etc.). I don't know of any way other than cross-browser testing to discover the exact values, and they may change when a new version of a browser is released! 4) If you don't want to open a new browser window, then you can use the Window.resizeTo() DOM call in order to modify the size of the current window. For both 3) and 4), security policy in modern browsers may affect: the success of opening a new window (i.e., pop-up blockers), and to place limits on net window size. 5) You can call the JavaScript/DOM code from your Flex application using the Flash ExternalInterface API. For more information, see (for example): http://livedocs.adobe.com/flex/3/html/help.html?content=passingarguments_4.html 6) For more information about the Window.resizeTo() browser DOM API, see (for example): http://msdn.microsoft.com/en-us/library/ms536723(VS.85).aspx 7) My _recommendation_ is that you consider abandoning the notion of a fixed-size application window. Flex containers support liquid layout very nicely and it is not much (extra) work to let your application work that way. In other words, if/when the user resizes their browser window, have your application adjust its layout accordingly. If you do that, I think that it is also reasonable to specify a (window) size below which your application won't be able to re-size itself to (and, thus, scroll bars may appear). Good luck! --Jim --- In [email protected], Gustavo Duenas LRS <gdue...@...> wrote: > > do you know where I can get examples of this ExternalInterface? > > Regards, > > Gustavo > > On Feb 2, 2009, at 10:45 AM, Tracy Spratt wrote: > > > > > If that works in javascript, in different browsers, then you can > > get those values through ExternalInterface > > > > > > > > Tracy Spratt > > Lariat Services > > > > Flex development bandwidth available > > > > From: [email protected] > > [mailto:[email protected]] On Behalf Of Gustavo Duenas LRS > > Sent: Monday, February 02, 2009 9:33 AM > > To: [email protected] > > Subject: [flexcoders] sizing dinamically the screen > > > > > > > > Ok, Coders, this is my problem I have set the width and height of my > > application to 1024 to 768 , it works on mac, but in pc you know what > > would happen with the IE7... > > well I just think this, just addind a creationComplete code like.... > > > > function initSize(){ > > > > screen.width= screen.availWidth; > > screen.height= screen/availHeight; > > > > this think works in Javascript there is counterpart on flex or it > > works on flex? > > > > I'd appreciate your help. > > > > Gus > > > > > > > > >

