This content has been marked as final.
Show 10 replies
-
1. Re: width and components acting weird
Ned Murphy Feb 22, 2009 5:41 PM (in response to kamckng)Can you measure the width of the contents (Label/List) instead? -
2. Re: width and components acting weird
kamckng Feb 22, 2009 5:50 PM (in response to kamckng)Actually I am yeah, i'd just rather have it working like it seems like it "should" or at least know why it doesnt work like it seems like it should so that it doesnt bother me haha. -
3. width and components acting weird
Ned Murphy Feb 22, 2009 5:57 PM (in response to kamckng)I wish I knew more about Sprites so I could answer your wondering. MAybe someone else will come along and shed some light on it. I only know that the few times I've tried to help someone with Sprite dimensional issues, they've baffled me. -
4. Re: width and components acting weird
kamckng Feb 22, 2009 6:04 PM (in response to kamckng)Haha, well thanks for takin' the time to reply!
Kyle -
5. Re: width and components acting weird
Rothrock Feb 22, 2009 7:00 PM (in response to kamckng)My guess is that it isn't a problem with Sprite, but rather a problem with components.
Components don't resize immediately. Because they have complex redrawing schemes, you setSize() and then one frame later the component is redrawn. Internally the component knows how wide it is supposed to be so if you query its width property you see the value you expect.
But the parent Sprite doesn't know about the internal state of the component, it just knows how bit it actually is, so that is why it reports the old width.
After one frame they will both be back in sync.
Interesting.... -
6. Re: width and components acting weird
kamckng Feb 22, 2009 7:14 PM (in response to Rothrock)I think I actually did read somewhere about it dispatching a resize event when it changes sizes, so maybe i should check that out and litsen for that then whenever i want to resize it, thanks for the tip, i'll look into it! Gives me some direction at least!
Kyle -
7. width and components acting weird
kamckng Feb 22, 2009 7:15 PM (in response to kamckng)Whoops, I double posted, sorry bout that. -
8. Re: width and components acting weird
Rothrock Feb 22, 2009 7:40 PM (in response to kamckng)I was just poking around a bit and you might want to look at UIComponent.validateNow(). That makes a component update immediately.
There is an overhead with it, so it probably should be used on a bunch of components in an ENTER_FRAME. But if it is just once at the set up of a component it might be a good idea.
BTW it is always a good idea to read every method, property, and event for when you start using a new class. It is amazing what you find in there! :) -
9. Re: width and components acting weird
kglad Feb 22, 2009 9:38 PM (in response to kamckng)hey, i think it's amazing what i'm still finding after years of using some of these clases. -
10. Re: width and components acting weird
kamckng Feb 23, 2009 7:38 AM (in response to Rothrock)Thanks, I'll take a look at that!



