Bloody hell, components suck in flash. (Rant ahead, read at own risk)
I'd been having issues with components in my program not updating properly so whenever I had flash components (Button, UIScrollBar, etc.) on the stage they'd render properly, but the container they were in would be irregularly sized because it would resize to the "previous" value. I just found out that it takes "two" frames to get the size, and the components looked fine because they'd been resized on the second frame, whereas the containers were resized only once, on the "incorrect size" frame.
So what do I do? (This was before I found out about the 2-frame business) I decided to ditch the components and roll out my own (yeah yeah I know) and all was fine and dandy! Things looked great! It took a lot of time, but it was worth it!
...That is, until I finish making the last component required: The ScrollPane. The fucking ScrollPane.
I use a mask: easy! Just override the getter and setter for width and height and it's all peachy. Nope. Turns out that despite the scrollpane showing the correct WxH as defined by the getter, the actual bounds include the invisible portion of the source. So if the scrollpane is 100x100 but the source image is 1000x1000, the actual size of the scrollpane's parent? 1000x1000. Despite only 100x100 being visible.
So I look around and then find scrollRect(). Looks promising, right? Wrong! Turns out, scrollRect() needs....2 frames to work properly! Meaning I'm back at square one! FUCK!
Now I have two options here:
1) I scrap the components I've made so far and go with the previous ones I had, and try and figure out how to deal with the premade flash components
or
2) I make a custom scrollpane with the 2-frame rendering business either way.
Help me out here, what's the license for said premade flash components? This is for a (possibly) open source thing, so I can't use the "you can use it if you bought flash* " excuse.
*about that...