DisplayObjectContainer size

Hi, i'd like to know if it's a bug, or if this works as it was supposed to: (this was tested in html5 only) for example, if you create a TextField with a text content, and add it in a new sprite instance with the "addChild" method and then if you want …

Viewing 1 to 3 (3 Total)
DisplayObjectContainer size

LeFabrice

LeFabrice
Total Posts: 34
Joined: April 02, 2012

Hi, i'd like to know if it's a bug, or if this works as it was supposed to: (this was tested in html5 only)

for example, if you create a TextField with a text content, and add it in a new sprite instance with the "addChild" method and then if you want to know the size of the whole stuff by retreiving the sprite's dimension, you get
width = 0, height = 0,
so it seems that the DisplayObjectContainer doesn't care about its children to return its size.

I guess if it's not a bug that i'll have to write some handler which updates at the Event.ADDED event and reset some "visibleSize" property by looping above all the children to see which one stands the most on the left, top, and finishes the most on the right, bottom.

Tags:
Posted on April 03, 2012 at 6:09 AM

Huge

Huge
Total Posts: 554
Joined: October 07, 2011

Re: DisplayObjectContainer size

The child size *should* be taken into account. It may just be a bug.

Hugh

Posted on April 03, 2012 at 10:32 PM

LeFabrice

LeFabrice
Total Posts: 34
Joined: April 02, 2012

Re: DisplayObjectContainer size

shall i submit this bug to the bug report page?

Posted on April 04, 2012 at 2:58 AM