I have a class that upon it’s construction do a backend request for data. When the data arrives it takes that data, loops it through and add a X number of childs with help of attachMovie in to a container - pretty straight forward huh?
**Now to the problem: **
The container do not receive a _width or a _height after the children are added. All the other properties it got correctly (checked _alpha, _visible, _x and _y - all set) just the _width and _height set to 0.
Solutions tried and failed:
Tried to have a empty movieClip put manually on the Scene as a container and connected the class to it through the library in the usual way. After the attachment of the item inside the container the container did not receive a _width or a _height even though the childs had it. I also tried to hard-code the _width and _height of the container - no difference; still 0. BUT if I manually added something to the container clip, like 1x1 pixel graphic or a guide or something, it works like a charm… Unfortunately I can’t do this solution as I need to be able to change the width and height for different instances without distorting the stuff inside the container.
I then tried to attach the container movieClip with code - no difference at all.
Then I used the class just as an ordinary object/sprite and not a MovieClip and created an emptyMovieClip as a Container on the scene from that object and added all the items in that container. Still the same result.
The first thing that do comes to mind is that I have traced it to early - but no thats not it. I creates all this in one frame, after the backend data has loaded for at least 10 frame-iterations. Then after all clips are ready then I tell scene to go to frame 2 where I actually show the right content and there I trace it. So between the constructor and the population it has gone several frames and between the population and the showing as well as the traceing it has gone even more frames. So no it can’t be that I trace it too early.
Have anyone had this problem before? I have really really gotten stuck on this so any input at all is very appreciated!!
Thanks in advance