Go Back   CodingForums.com > :: Client side development > Flash & ActionScript > Adobe Flex

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-15-2010, 08:28 PM   PM User | #1
saha ch
New to the CF scene

 
Join Date: Jan 2010
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
saha ch is an unknown quantity at this point
auto scroll contents of datagrid

I have written this functionto autoscroll the contents of the datagrid. i call the scrollDG method for the datagrid i want to scroll automatically. It scrolls automatically only once and goes to the next row, does not go till the end of the datagrid. Any suggestions please??



private var scrollTimer:Timer = new Timer(0,0);











private function scrollDG(dg:DataGrid):void
{



/*If scrollable start a timer and loop through til you hit the max vertical scroll position

then reverse*/

currDg = dg;



if(currDg.maxVerticalScrollPosition > 0){






if(scrollTimer.running){

scrollTimer.reset();}

scrollTimer =


new Timer(3000,currDg.maxVerticalScrollPosition);

scrollTimer.addEventListener(TimerEvent.TIMER,onScrollTimer);

scrollTimer.start();



}



}




private function onScrollTimer(event:TimerEvent):void{



if(currDg.verticalScrollPosition < currDg.maxVerticalScrollPosition)

{

currDg.validateNow();

currDg.verticalScrollPosition = currDg.verticalScrollPosition + 1;

scrollDG(currDg);

}




else{

currDg.verticalScrollPosition = 0;

}




if(currDg.verticalScrollPosition == currDg.maxVerticalScrollPosition )

{

currDg.verticalScrollPosition == currDg.maxVerticalScrollPosition;

scrollDG(currDg);

}

}
saha ch is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:33 PM.


Advertisement
Log in to turn off these ads.