Background images in HBoxes and VBoxes

I have built a page in mxml, and would include a background images for the components of some of the mx:HBox and mx:VBox elements that I use. Looking around online, it seems that a property "backgroundImage" would be what I would need to set however I keep getting errors that no property exists. Is this something that has changed in Flex 4 or am I missing something?

Thanks for any help.

To create a background for a HBox, you could do something like this:

Tags: Flash Builder

Similar Questions

  • Background image of display and scrolling VFM

    Right now, I'm stuck trying to give the desired result work on my screen. I already know the basics of adding a background to a Manager (value bit flags USE_ALL_WIDTH and USE_ALL_HEIGHT so that paint void). However, I must also deal with a child growable VFM attached to the screen can scroll if the height is greater than the height the screen less the height of the top banner field. What I want to achieve is the following: having a screen that does not scroll with a background image that is attached to the dimensions of the screen less field height of the banner (first low-level with the BG Manager). However, I want the VFM child to be able to scroll if necessary while the BG image is displayed in the background. Here's what I have so far to my constructor:

    public MyMainScreen(){
       super( NO_VERTICAL_SCROLLBAR );
       VerticalFieldManager myVFM = new VerticalFieldManager(
                                    VerticalFieldManager.USE_ALL_WIDTH
                    | VerticalFieldManager.NO_HORIZONTAL_SCROLL
                    | VerticalFieldManager.NO_VERTICAL_SCROLLBAR
                    | VerticalFieldManager.FIELD_TOP
                    | VerticalFieldManager.TOPMOST
                    | VerticalFieldManager.BOTTOMMOST );
       setBanner(myBannerField);
       //fields are added to VFM.....
    
       VerticalFieldManager bgManager = new VerticalFieldManager(
                                    VerticalFieldManager.USE_ALL_WIDTH
                                    | VerticalFieldManager.USE_ALL_HEIGHT
                                    | VerticalFieldManager.NO_VERTICAL_SCROLL){
               public void paint(Graphics g){
                  //my BG gets drawn here...
                  super.paint(g);
               }
       };
       bgManager.add(myVFM);
       add(bgManager);
    }
    

    So, I just need to know if I'm doing something wrong here. Of course, it may be obvious to some, but for some reason that I'm completely stumped. Thanks in advance.

    Tried again without the substitution of sublayout, and he managed to work given my VFM populating routines, because the domain in question (HFM) that is updated is added without all the fields added initially, so my VFM has all the fields, it needs at that point to have himself. You're right, if I wanted to complex me and choose to place the fields of optimization of resources on particular points, it would be wise to replace sublayout and define to what extent, accordingly, but in this case, it works fine without it. Anyway, the people, the answer today is that your screen does not scroll by setting super (NO_VERTICAL_SCROLLBAR |) NO_VERTICAL_SCROLL) in the constructor, however, if you want the custom vertical scrolling on your VOR with BG, you must set to vertically, do scroll down and use the height by passing the following style bits:

    VerticalFieldManager.USE_ALL_WIDTH
    | VerticalFieldManager.NO_HORIZONTAL_SCROLL
    | VerticalFieldManager.VERTICAL_SCROLL
    | VerticalFieldManager.NO_VERTICAL_SCROLLBAR
    | VerticalFieldManager.USE_ALL_HEIGHT

    then you replace paintBackground appeal of this optimization of the resources any desired call paint and that's it.

  • Problem of layout with HBox and VBox

    I want to create a login screen which is always centered on the screen. In the login screen I want two text fields must be aligned vertically and two corresponding text input fields must be aligned vertically. I can't understand the correct use of VBox and HBox to achieve my goal. Is there a simple way to think about it - must - I use something other than VBox and HBox? The code below is partially correct, but the text input areas are not aligned vertically.

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml '
    Layout = "vertical".
    verticalAlign = "middle" >
    < mx:VBox >
    < mx:HBox >
    < mx:Label text = "Username" / >
    < mx:TextInput text = "test text" / >
    < / mx:HBox >
    < mx:HBox >
    < mx:Label text = "Insert here the password" / >
    < mx:TextInput text = "password" / >
    < / mx:HBox >
    < / mx:VBox >
    < / mx:Application >

    I think you want a form to do this:

  • Set the explicit width and height of the background picture in HBox

    Hello

    I need set the width and the height of the background image in Hbox. Please give me a sample.

    Kind regards

    Roman.

    Hello

    You can use property backgroundSize, but you must assign a percentage value it. As,

    backgroundSize="100%"
    

    Or you can place the HBox and Image control in a Canvas, such as the Image appears as a background for the HBox. Something like that

    
         
         
    
    
  • background image problem

    Hi, I have a strange problem with my project, I have a background image JPG (271 k) set as the background of my front (option in the Center), if I load the VI this race 6-7 cycles per second in a loop of cheating, but if I VI and put the background image to NONE, and after that, I have re - adjust my image as a background and run the vi it run at 20-25 cycles per second It's so crazy... I can't understand this is possible and I'm going crazy trying to solve this problem.


  • Scrolling Background Image

    Hi all

    I added the background image on the screen, but the problem is, if I scroll the background image Monte

    and the white screen appears in the background .is there anyway to scroll to the bottom of the background image

    Concerning

    Yogi

    Have you checked these threads.

    http://supportforums.BlackBerry.com/T5/Java-development/about-background-images-and-layouts/m-p/2443...

    http://supportforums.BlackBerry.com/T5/Java-development/drawing-bitmap-in-mainScreen-background/m-p/...

    Concerning

    Bika

  • cannot Center my background image in windows 7

    I can't understand why his does not work, but I can't focus my background images. It will be only stretch them across the screen. I just want to focus. When I click on Center and save the changes, nothing happens. Help!

    Hi Heather,

    Do you use a Hewlett Packard? If so, the solution below works 99% of the time.

    • Step by step:

    1. go to http://www.hp.com/#Support

    2 Select software button step 1 and download drivers
    3. under Step 2, enter your product name (e.g. pavilion 2022... be very careful because the I don't know the precise model is important.)
    4. click on the link corresponding to your model of PC
    5. choose the Windows 7 operating system (assume that you will be 32-bit)
    6 scroll the list Select software and drivers and choose Activator position photo Wallpaper

    > If you do not find the name of your product in 3. over here, you can run the sp45575.exe fix:

    > If running that you're afraid of a blind exe file, you can read about the sp45575.exe here:

    Sharon Roffey, QLD, Australia

  • How to fade along with a background image.

    Does anyone have a suggestion on how better to fade along with a background image, which left and right side exactly blends in the background. In addition, it should be a very gradual fade.

    My image is a model of 18px 1900px X and it supposed to repeat on the y-axis. I did apply a layer mask, select from the left and the right 250 250px. Then I went to put smoth to 100% and the feather to 100px, and cut the fethers part to see the fade.  It worked well, but you are still able to see the visible lines on each display of color fade. The re is a better way to fade and other image or something else I can try to make the transition to choke?

    Thank you!

    Looks like bands, not feather. try to work in 16-bit...
    / G

  • background images appear evil in the browser

    OK, his mercy, it's my first DW website. www.Bourne.GB.com/TestArea

    I put the two div in the container, one above the other downstairs, with a background image repeated on the Center to give a single image extensible backround page. "It appears correctly in DW, using live view and local files, but when I go to the page, the background image appears corrupt and won a comment alt, probably from the browser that says - 'image' http://www.bourne.gb.com/testarea/images/containermid.gif ' cannot be displayed, because it contains errors. »

    I tried with different image formats, jpg and gif and I checked the file on the host server and the image is fine as long as it is not part of a page. My guess is that I screwed up something in the div or the css somehow. But I just spent a few hours looking for clues and came up empty.

    If it is an old problem, my apologies for not finding a previous answers, if it is a new, then at least I was original!

    OK, I cracked, but maybe not in a good way.

    I had avoided using png for background images files because I heard that IE has problems with links that overlap png backgrounds, effectively breaking navigation. Unfortunately I can't test this reliably until my pc friends give it a try. But change the png format solves all problems display on my browser.

    If someone can advise on the wickedness of this method?

    Oh, and no one knows why opera has a display problem with shadows in swf animations. A soft shadow with an alpha of about 60% poster fine while he drives, but as soon as you get to the stop command, it turns solid and opaque.

  • How to block Background Images?

    Hello

    I have problems with sensory processing and when I sometimes scrolling on pages with background images, the text moves and the background image is not, and this triggers my migraines.

    I tried to use preferences > content > colors options and style "text on white background", * and they help, but on some sites (and not on this site) they make it impossible to see what I'm typing errors.

    Does anyone know of a good way to block images from bottom without this problem, or can be displayed/hidden?

    If the problem is only that the background does not scroll this bookmarklet could help.

    Make a fixed background image attached to the scrollable body element.

    javascript:void(document.body.style.setProperty("background-attachment","scroll","important"));
    

    You can create a new bookmark and paste the bookmarklet JavaScript code into the location field.

  • I've just updated to Firefox Beta 20. Not happy! The options "View Background Image" and "Image Mode" when you right-click is missing. How can I get that back?

    I've just updated to Firefox Beta 20. Not happy! The options "View Background Image" and "Image Mode" when you right-click is missing. How can I get that back?

    These entries should still be there if you right click on an image or an area with a background image.

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance).

    • Do NOT click on the reset button on the start safe mode window or make changes.
  • MacBook Pro stops when the lid closes, loses the open tabs and background image...

    Hi all

    I recently had a new hard drive installed in my 2012 13-inch MacBook Pro. I am running El Capitan 10.11.2. Since then, my computer cuts automatically to the bottom when the lid is closed, losing all Web pages, and for some reason, some background, I've saved. (My browser is Mozilla Firefox and it prompts you to restore me the tabs lost, which he will).

    The led standby does not blink or light up when the computer is turned on, it will turn on only at startup. At startup, the login page is displayed, and after that I entered my password it takes about 15 to 25 seconds to load and open my account. What is going on?!

    Summary:

    Stop when the lid is closed,

    Loses the background image & open Web pages.

    Standby blinks only when starting,

    Time of loading extended after logging into my account.

    Any help would be greatly appreciated! Thanks a lot for reading.

    uhlexia wrote:

    Hi all

    I recently had a new hard drive installed in my 2012 13-inch MacBook Pro. I am running El Capitan 10.11.2. Since then, my computer turns off automatically when the lid is closed.

    Take it back to the repair as well as your receipt of repair shop.  Apple has a 90 day warranty on all repairs.

  • Windows Vista cannot see this background image instead, I see a solid blue color during startup and shutdown

    original title: background logon of windows vista I do not see this background image instead, I see a solid blue color during startup and shutdown

    I use a laptop with windows vista home basic 32-bit sp2

    After turning on the computer laptop, I get a prompt to enter the password at this point, I would usually get a background image and the same background image appeared when I stopped

    I do not see this background image instead, I see a blue solid color when you start and stop as the background image has been replaced by a blue color

    I followed all the steps of the following

    http://www.howtogeek.com/HOWTO/Windows-Vista/customize-your-Windows-Vista-logon-screen/

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-desktop/can-you-customize-the-logon-screen/75def0ce-2dc4-48c1-B290-daaf685efca4

    http://www.Vistax64.com/tutorials/79886-logon-screen-change.html

    However, I don't see the background image. the background image is in the right folder location whith the required size as jpg image with the exact registry required such as mentioned in the above links entries

    How do I solve this problem

    Hello

    Did you do changes on the computer before the show?

    You can try the steps and check if you are able to see the background on the logon screen.
    a. Click Start, and then type gpedit.msc
    b. navigate to Computer Configuration and go to administrative templates and go to System.
    c. go to connection and set the "bottom always use custom logon" to activate.
    d. create a folder named C:\Windows\System32\oobe\info\backgrounds
    e. put the file you want, and then name it backgroundDefault.jpg
    f. check your other background for the dimensioning of the info files

  • Cascades: How to set the background image for the menu drop down and etc...

    Hello

    Is there an easy way to set the background image for the menu drop down and etc, current support only black as a background?

    Thank you

    Tom.

    Welcome to the forums!

    This is currently not supported unfortunately.

    I encourage you to save a feature for this request:

    https://www.BlackBerry.com/JIRA/secure/dashboard.jspa

    See you soon!

    Martin

  • BlackBerry 5 - image with text and the background transparent resizing

    Hey,.

    My application consists of a series of images stacked on each other. Some are transparent, some are not. I use images high resolution and resize them based on the width of the screen of the blackberry that runs the application.

    I'm having some trouble resizing of images with text on a transparent background. The resulting image is not of all anti-aliasing. This is the code I use to do:

    function scaleBitmap(Bitmap bmp){
    
    int rgb[] = new int[imageWidth * imageHeight];
    bmp.getARGB(rgb, 0, imageWidth, 0, 0, imageWidth, imageHeight);
    int rgb2[] = rescaleArray(rgb, imageWidth, imageHeight, width, height);
    scaledBmp.setARGB(rgb2, 0, width, 0, 0, width, height);
    
    return scaledBmp;
    }
    

    And here are the results from a group of images resized in photoshop:

    Is it possible that I could improve my resize code to give better results?

    Thanks in advance!

    I found a solution and it is on these forums all the time!

    http://supportforums.BlackBerry.com/T5/Java-development/solution-for-properly-resizing-transparent-b...

Maybe you are looking for