?
Solved

How do I resize a panel object when removing some of it's children?

Posted on 2009-04-29
6
Medium Priority
?
628 Views
Last Modified: 2013-11-11
I have a very simple panel in a flex app.  This panel has several buttons.

I can remove these buttons at will, via the panel.removeChild(buttonName) call.  That works fine.

Is there a way for me to then resize the panel once this child display object is removed?  I want the panel to grow in size dynamically, based on the content within.  There is no option for not including the child in the layout before or after it is removed, or if there is, I cannot find it.
0
Comment
Question by:csciguy81
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:lexxwern
ID: 24266858
Have you specified a width and height for the Panel? By default it should fit its children's size (hence resize automatically on Add/Remove of children) if the width & height are not defined.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 24267516
Did you already try

panel.invalidateProperties();
or
panel.invalidateDisplayList();
or
panel.invalidateSize();
or a combination

after removing of the button?
0
 

Author Comment

by:csciguy81
ID: 24272841
The width/height of the panel is not defined.  It takes on the size of the child components width/height.

I will give any of those a try and report back.  
0
 

Author Comment

by:csciguy81
ID: 24476596
The app has taken a bit of a different direction so to speak.  Is there a way to resize the panel, but to always have it fit into the width or height of the resolution that the screen/browser is set to?

Basically if I make an app at 1024x768, and someone views it at 800x600, then the 800x600 person has to scroll around.  Is there a way to automagically make my app scale or shrink down to fit their screen?
0
 
LVL 37

Accepted Solution

by:
zzynx earned 500 total points
ID: 24480590
>> Is there a way to resize the panel, but to always have it fit into the width or height of the resolution that the screen/browser is set to?
That's maximizing the panel.
This will probably be useful for you: http://flexscript.wordpress.com/2008/08/28/flex-minimize-maximize-panel-component/
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question