It might be more important "when" you do this calculation.  Flex is an
invalidating framework meaning that when you add children, it
invalidates the parent container and it is "later" that the parent
container reacts and puts up scrollbars.  I would try catching the
updateComplete event and then you should be able to use height and
verticalScrollPosition.

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Brian
Sent: Friday, November 02, 2007 7:16 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] how to determine if a component is offscreen in a
Canvas?

 

I'm using a Canvas where I'm adding components dynamically at absolute
positions, which may increase the size of the canvas beyond it's
parent container. When this happens, scrollbars are created, as
expected and desired. I'm trying to figure out if the component I just
added are offscreen, in the clipped area. If that's the case, I want
to be able to make that newly-added component visible by manually
adjusting the scrollbars.

I've done this before in another development environment so I know the
logic to do, but I'm new to Flex and struggling to find which
properties to use, amongst all the different properties and methods,
i.e. height, maxHeight, measuredHeight, scrollPosition, etc.

Thanks

 

Reply via email to