A Flash Developer Resource Site

Results 1 to 1 of 1

Thread: as2 help with scrollbar - please!

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    11

    cs3 - as2 help with scrollbar - please!

    I am having a very difficult time trying to make this scroll bar work. I am not math-minded, and I have been doing a lot of trial & error coding below. Sorry for the bad code.

    An xml playlist item name is attached to the songbutton. The main issue I am having is that the list continues to scroll past the actual list items. How do I tell it to stop once it gets to the bottom of the list? Please let me know what other information I need to give in order to get help with this coding.

    Thank you!

    Code:
    if(playlist._height <= playlist.itemsmask._height){
    	scroller_mc.slider_mc._visible = false;
    }
    else{
    	scroller_mc.visible = true;
    }
    
    scroller_mc.slider_mc.slider.onPress = function(){
    	scrolling = true;
    	
    	this._parent.startDrag(0, this._parent._x, this._parent._parent.scrollBg_mc._y,
    	this._parent._x, this._parent._parent.scrollBg_mc._y + this._parent._parent.scrollBg_mc._height);
    }
    scroller_mc.slider_mc.slider.onRelease = function(){
    	scrolling = false;
    	this._parent.stopDrag();
    }
    
    scroller_mc.slider_mc.slider.onReleaseOutside = function(){
    	scrolling = false;
    	this._parent.stopDrag();
    }
    	//controls the scrolling of the playlist
    	if(scrolling == true){
    		if(playlist.songbuttons._height > playlist.itemsmask._height){
    			
    			percentScroll = (scroller_mc.slider_mc._y/(scroller_mc.scrollBg_mc._y + scroller_mc.scrollBg_mc._height));
    			
    		
    			
    			playlist.songbuttons._y = (playlist.itemsmask._y - (playlist.songbuttons._height - playlist.itemsmask._height) * percentScroll) - 10;
    			
    		}
    		
    	}
    Last edited by obli7vion; 10-11-2008 at 08:10 PM.

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