BadmintonCat
BadmintonCat

Reputation: 9576

Flex 4: Scrolling a Spark Form to focussed element programatically?

I found this example http://blog.flexexamples.com/2009/11/02/auto-scrolling-the-contents-of-a-vgroup-container-in-flex-4/ which works great but only if you have the focussable elements in a VGroup.

However I have a Form inside the VGroup which means that the focussable elements are in FormItems of the Form. The Form can't be added directly into the Scroller and doesn't have a layout property.

I could use form.getElementIndex(formItem) and then do some math using the formItem y position but that's very ugly. Anyone have an idea how to get this working in a clean way like the above example?

Upvotes: 2

Views: 1243

Answers (1)

BadmintonCat
BadmintonCat

Reputation: 9576

Woot woot! I just found Scroller.ensureElementIsVisible()! Nevermind! :D

Upvotes: 1

Related Questions