|
The width of the component is 0 until the
component is given size by its parent during layout (which is when
updateDisplayList gets called). After that it is good to go. If
your issue is about binding to maxAvailGutter and not seeing it updated, the
trick is to create a binding event for it so the system knows what to listen
for. [Bindable(event=”updateComplete”)] public function get
maxAvailableGutter():Number { Return
Math.min(unscaledWidth,unscaledHeight)/2 – 1; } The binding system then looks for the
updateComplete event which is sent after updateDisplayList is done. From: I'm making an image cropping component,
and it's 98% of the way done. I'm running into an issue and need a
technique / strateg-ery advice, please: The component allows the user to drag an Image around under
a crop "window" (width and height adjustable). The cropped
result can be gotten as an Image or BitmapData to be sent to the server, shown
on the screen, or, well, whatever the developer wants to do with the
data. One property of the component is "gutter". It's a 1
pixel -- ? pixel thick border all around the edges that the image does not show
through. It allows the sides of the crop window to be pulled all the way
to the edge of the image and still be visible (the gutter is forced to be at LEAST
1 pixel). I hope that manes sense. I want the component to have a 'get' property called
"maxAvailableGutter So... Everyithng works fine, except when the component
initializes itself. It seems like "unscaledWidth" is not yet
defined? I'm wondering how to have values available as get where their
calculation depends on the width and height? Should I not be using
"unscaled" outside of updateDisplayList ('cause I am -- get
maxAvailableGutter is its own function). Thanks! I'll upload some code if needed, just not near my
development box right now. -- TC PS - I'm really psyched this group exists
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- [flexcomponents] initialization and binding to setters Clare Todd
- RE: [flexcomponents] initialization and binding to setters Alex Harui
