Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6370219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:54:07+00:00 2026-05-25T00:54:07+00:00

I have a container with a vertical layout inside which I have two other

  • 0

I have a container with a vertical layout inside which I have two other child containers “A” and “B”.

In the first container “A” there is a component that I would like to resize dynamically based on the available display size.
To to that I tried listening to the resize event of the main container and do my measures accordingly.
That works somewhat until the parent container reaches a clipping size : container “B” gets clipped earlier than “A” because it contains much more stuffs :
As soon as the parent container reaches “B”‘s clipping size, it does not resize anymore (so no more resize event either) thus preventing me from updating my component’s display in “A”.

Any directions would be much appreciated.
Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:54:08+00:00Added an answer on May 25, 2026 at 12:54 am

    You’ve got something like this (correct me, if I’m wrong):

    <mx:VBox>
        <mx:VBox id="A" width="100%" height="100%">
            <CustomComponent id="component" width="100%" height="100%"/>
        </mx:VBox>
        <mx:VBox id="B"/>
    </mx:VBox>
    

    You don’t need to listen to resize events, Flex containers can resize automatically. Your resize layout behavior is reached by assigning proper size in percents for container A and your component. Here you have container A, which occupies all the free space provided by its parent – top container. Therefore your inner component occupies all the free space provided by its parent – component A. When top container resizes, its children will automatically resize themselves.

    In pure ActionScript the corresponding properties are percentHeight and percentWidth.

    UPD

    1) The problem with size of B is solved by adding minWidth="10" (or 0, or min size you want). That forces B to resize with parent container, even if there’s not enough space in parent.

    2) If you want to do some different layout in you custom component, or to make some calculations, based on new component size, you should override function “updateDisplayeList” in your custom component:

    override protected function updateDisplayList(unscaledHeight:Number, unscaledHeight:Number):void
    {
        super.updateDisplayList(unscaledWidth, unscaledHeight);
    
        // your calculations
    }
    

    This function is called by Flex layoutManager, when the component needs to refresh its size and/or children positions. The arguments represent available space for component.

    More on Flex component lifecycle:

    • http://livedocs.adobe.com/flex/3/html/help.html?content=ascomponents_advanced_2.html
    • (strongly recommend) http://www.developmentarc.com/site/articles

    3) Some sort of offtop.

    I’ve got a feeling, that you simply have VBox of Labels, and these Labels don’t want to resize with its parent. This problem is solved by assigning some small value to Labels’s minWidth – after that Labels will be correctly truncated if they exceed parent size.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a container div that holds two internal divs; both should take 100%
I have a Horizontal Layout in which some vertical layouts are dispatched. I want
I have a vertical layout that I want to remain centered on the page.
I have a container element which I need to resize as its contents change.
I have a container of custom controls each of which have 2 controls in
I have a container that contains an image that I need to drag from
i have a container box that includes a number of thumbnails. i earlier made
I have a container DIV which contains several block-DIVS. Every block-DIV contains SPAN items
I have a container MovieClip that serves as a content area that I need
I've got a DataGrid control that's within a Grid layout container, and I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.