http://blogs.adobe.com/aharui/2008/01/flex_and_scalemodes.html

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of kolt_siewerts
Sent: Thursday, December 20, 2007 2:01 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: How do I make the background fill the whole
screen, not just the Application

 

That works in the default "NO_SCALE" scaleMode. 
But I need my app to be "SHOW_ALL". 
So everything gets scaled to the maximum width/height of the window. 

Here is another example: http://kolt-siewerts.com/flexTest/helloWorld/
<http://kolt-siewerts.com/flexTest/helloWorld/> 
(right-click for source view)

The text scales just like I want it to: according to the window-scale.
But if you scale the 
browser window to an extreme 5:1 ratio, you see a black bar at the
sides. 
And no, setting maxWidth or minWidth does not work ;)

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, Joseph Balderson <[EMAIL PROTECTED]> wrote:
>
> Your Application should stretch with the inner browser width & height
by 
> default, you don't need to monkey with the Stage object like you do in

> Flash.
> 
> If what you want is a background which covers the whole browser
screen, 
> let the Application fill up the space. Then place the rest of your 
> content in another container. For instance, if you want your content
to 
> be centred on the stage but your content to absolutely positioned, use

> the following code:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
> layout="vertical"
> horizontalAlign="center"
> verticalAlign="middle"
> backgroundColor="#000000"
> backgroundGradientAlphas="[1.0,1.0]"
> backgroundGradientColors="[0x000000, 0x3333AA]">
> <mx:Canvas
> backgroundColor="#FFFFFF"
> width="400" height="400">
> <mx:Button label="daButton1" top="20" left="20"/>
> <mx:Button label="daButton2" right="20" bottom="20"/>
> </mx:Canvas>
> </mx:Application>
> 
> The two buttons use constrained layout positioning as opposed to 
> absolute positioning, so they "float" a certain distance from the
sides 
> of the canvas container.
> 
> __________________________________________________________
> 
> Joseph Balderson, Flash Platform Developer | http://joeflash.ca
<http://joeflash.ca> 
> Writing partner, Community MX | http://www.communitymx.com
<http://www.communitymx.com> 
> Abobe Certified Developer & Trainer

 

Reply via email to