header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
Sahil
Points:0
Posts:0

2/7/2011 2:43:03 AM

Title: spark list control vertical scroll position flickers


i have list control in flex 4, when i add items to it i want the scroll to reach the maximum vertical scroll position. the list has a renderer.

For this I have used:
list.layout.verticalScrollPosition = list.dataGroup.contentHeight - list.dataGroup.height;

The problem is that i want to show the max vertical scroll position as soon as the item is added to the list. So i have used in code:
arrCollection.addItem(myObject);
list.layout.verticalScrollPosition = list.dataGroup.contentHeight - list.dataGroup.height;

These two operation one after the other are does not solve the problem so i used callLater (two times) for setting verticalScrollPosition like:
callLater(function laterSetVerticalScroll():void
{
callLater(function laterSetVerticalScroll():void
{
list.layout.verticalScrollPosition = list.dataGroup.contentHeight - list.dataGroup.height;

});
});

DUE TO THIS LATER CALL THE SCROLL SHOWS A FLICKER (like it goes to vertical scroll 0, and then this method is called later), i very bad looking flicker on each additem.

I have already used list.ensureIndexIsVisible(arrColl.length - 1), this doesnt help either.

Please suggest a solution. Thanks



1
FlashBuddy
Points: 0
Posts:0
2/9/2011 6:05:47 AM



I think the best way would be to , see the last event which is triggered when a new item is added to list. Its kind of hit and trial. When a item is added to list many list events get fired like, initialized, changed etc. You can add your scrollbar positioning code to the last event fired.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 6+2 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions