Height of component increasing when adding children

I have a simple flash component that is just a rectangle with a border around it. This component represents my chat box. I then create 20 TextFields that will be overlapped on the component to display text.

The odd thing that is happening is that my components height is originally 200, but with each textfield i add as a child to the component the height data of the component increases by the height of the textfield.

Let me clarify that the height of the object in pixels is not changing, but simply the this.height of the component. I can make a static const that I can use for the original height of the component, but I find this behavior strange.

Could anyone comment on why this is happening?



This is expected behavior. The height property of a parent will include all of its children, same with the width property.

Any graphics drawn inside of this parent will not change, you would have to update this manually by creating a nested clip and adjusting its size.

Need Your Help

TableviewDataSource in own file does not conform to protocol UITableViewDataSource in swift

uitableview swift protocols

Error: Type "MapListDataSource" does not conform to protocol "UITableViewDataSource"

Display byte array in gsp

grails gorm

I want to loop through this class and display in a table. what is the easiest way to display the image?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.