dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: Custom scrollers for the TileList

  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    35

    Custom scrollers for the TileList

    Anyone know how, or seen a tutorial on how to control the scroll bar position of the TileList component? I'd like to turn them off, and use the mouse position left or right of center to scroll it in one direction or the other. I've seen similar things with out the component for AS2, but that just willn't do.

    Thanks.

  2. #2
    Member
    Join Date
    Nov 2007
    Posts
    67
    the following might help it dose not use a data grid but is similar to what you are lookin for:

    http://www.flepstudio.org/forum/flep....html#post6589
    Last edited by arsenik; 12-26-2007 at 08:02 AM.

  3. #3
    Member
    Join Date
    Nov 2007
    Posts
    67
    ok , you have to change the scrolling part of the following code, it is not that much friendly , did not spend much time on it.

    PHP Code:
    import fl.controls.DataGrid;
    import fl.controls.ScrollPolicy;
    import fl.data.DataProvider;
    import fl.events.DataGridEvent;
    import fl.events.ListEvent;


    var 
    i:uint;
    var 
    totalRows:uint 50;
    var 
    dp:DataProvider = new DataProvider();
    for (
    0totalRowsi++) {
        
    dp.addItem({Title:getRandomNumber(), col2:getRandomNumber(), col3:getRandomNumber(), col4:getRandomNumber()});
    }

    var 
    myGrid:DataGrid = new DataGrid();
    myGrid.setSize(500300);
    myGrid.columns = ["Title""col2""col3"];
    myGrid.dataProvider dp;
    addChild(myGrid);
    myGrid.verticalScrollPolicy=ScrollPolicy.OFF
    myGrid
    .addEventListener(MouseEvent.MOUSE_MOVE,_move);


    function 
    getRandomNumber():uint {
        return 
    Math.round(Math.random() * 100);
    }


    var 
    j:int=0
    function _move(event:MouseEvent):void{
            
            if(
    event.stageY<myGrid.y+(myGrid.height/2)&&j>0&&j<=totalRows)myGrid.scrollToIndex (j-=1
            if(
    event.stageY>myGrid.y+(myGrid.height/2)&&j<totalRows&&j>=0)myGrid.scrollToIndex (j+=1

        } 

  4. #4
    Member
    Join Date
    Feb 2003
    Posts
    35
    Thanks, I'll see if I can tweak this for the TileList component.

  5. #5
    Member
    Join Date
    Feb 2003
    Posts
    35
    Hm.. using the scroll to index doesn't get a nice scrolling effect. I'm loading images up in the tileList. If you don't see the images change, you don't realize it ever scrolled for the lack of horizontal motion in my case.

  6. #6
    Member
    Join Date
    Nov 2007
    Posts
    67
    simply use a mask over your titlelist and change the .x .y properties of the title list, you can use ready to use , plugnplay classes like tweener or tweenlite to get a better motion, I am not gonna provide you with code this time cause you are getting used to the fish, go fish for yourself ha ha ha ha just joking, try the above and see if it helps.

  7. #7
    Member
    Join Date
    Nov 2007
    Posts
    67
    the following webpage coud be of help too:

    http://www.adobe.com/devnet/flash/qu...component_as3/

  8. #8
    Member
    Join Date
    Feb 2003
    Posts
    35
    That's a good idea. Why am I stuck thinking I should move the content of the thing when I can just move the thing its self, under a mask of coarse. My brain defaults to the obvious. I forget this is flash.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center