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";
        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
Writing partner, Community MX | http://www.communitymx.com
Abobe Certified Developer & Trainer


kolt_siewerts wrote:
> Dear group,
> coming from the Flash side of AS3-Development, I'm struggling with a small 
> problem.
> 
> Here is an example (source code via right-click):
> http://www.kolt-siewerts.com/flexTest/
> 
> My application has to grow with the window, so I set StageScaleMode.SHOW_ALL 
> instead of 
> the default "NO_SCALE".
> Now whenever the window has not the same aspect ratio as the Application, 
> black bars 
> appear.
> But I want the background of my App to fill the screen no matter what ratio 
> the window has. 
> 
> Thanks for any ideas or hints, I've searched the internet for a couple of 
> days now and did not 
> find a solution...
> Regards,
> kolt
> 
> 
> 
> --
> Flexcoders Mailing List
> FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
> Yahoo! Groups Links
> 
> 
> 
> 

Reply via email to