Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » Scroll Bar/Area help


Scroll Bar/Area help

Reply
  #1 (permalink)  
Old 06-15-09, 12:48 PM
SD Designs SD Designs is offline
New Member
 
Join Date: Jun 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Scroll Bar/Area help

I have a scroll area/bar from a flash template that always cuts off the last line of text, no matter how little or much text there is.

Posted script below, I am very new to flash and just cant figure out what is set wrong here. I never edited the script, just added text to the existing fields.

Thanks for any help!

onClipEvent (load) {
buttonSize = 0;
viewHeight = _parent.scroll_bg._height;
viewWidth = _parent.scroll_bg._x;
scrollContent = _parent.for_text;
heightCorect = false;
mouseWheelHitTest = true;
wheelStep = 1;
pageStep = 10;
pageStep2 = 10;
pageDelay = 200;
arroyStep = 10;
arroyStep2 = 0.5;
arroyDelay = 3;
speedDec = 0.650000;
scrollStep = _parent.speed;
_x = scrollContent._x+viewWidth;
_y = scrollContent._y;
dragButtonIsDraging = false;
scrollPos = 0;
upButton._y = 0;
pageUpButton._x = 0;
pageDownButton._x = 0;
contentHeight = heightCorect ? (scrollContent.height) : (scrollContent._height);
scrollHeight = viewHeight-buttonSize*2;
dragButtonHeight = viewHeight<contentHeight ? (viewHeight*scrollHeight/contentHeight) : (scrollHeight);
dragButton._yscale = dragButtonHeight;
dragButton._y = buttonSize;
downButton._y = buttonSize+scrollHeight;
blanckDown._y = downButton._y;
blanckUp._x = 0;
blanckUp._y = 0;
blanck._x = 0;
blanck._y = buttonSize;
blanckDown._x = 0;
pageUpButton._y = buttonSize;
blanck._height = scrollHeight;
blanckUp._visible = viewHeight<contentHeight ? (false) : (true);
blanck._visible = viewHeight<contentHeight ? (false) : (true);
blanckDown._visible = viewHeight<contentHeight ? (false) : (true);
upButton._visible = viewHeight<contentHeight ? (true) : (false);
dragButton._visible = viewHeight<contentHeight ? (true) : (false);
downButton._visible = viewHeight<contentHeight ? (true) : (false);
_parent.drag._visible = viewHeight<contentHeight ? (true) : (false);
_parent.down._visible = viewHeight<contentHeight ? (true) : (false);
if(viewHeight>contentHeight) { _parent.for_text._x+=5}
mouseListener = new Object();
mouseListener.onMouseWheel = function(delta) {
if (!mouseWheelHitTest || scrollContent.hitTest(_root._xmouse, _root._ymouse, false) || hitTest(_root._xmouse, _root._ymouse, false)) {
dragButton._y = dragButton._y-delta*wheelStep;
if (dragButton._y<buttonSize) {
dragButton._y = buttonSize;
}
if (dragButton._y>buttonSize+scrollHeight-dragButtonHeight) {
dragButton._y = buttonSize+scrollHeight-dragButtonHeight;
}
}
};
Mouse.addListener(mouseListener);
curY = -scrollContent._y;
vY = 0;
mask = scrollContent._parent.createEmptyMovieClip("mask", scrollContent._parent.getNextHighestDepth());
with (mask) {
beginFill(255, 50);
lineStyle(0, 16711935, 100);
moveTo(scrollContent._x-1000, scrollContent._y);
lineTo(scrollContent._x+1000+viewWidth, scrollContent._y);
lineTo(scrollContent._x+1000+viewWidth, scrollContent._y+viewHeight);
lineTo(scrollContent._x-1000, scrollContent._y+viewHeight);
endFill();
}
scrollContent.setMask(mask);
}
onClipEvent (enterFrame) {
blanckUp._visible = viewHeight<contentHeight ? (false) : (true);
blanck._visible = viewHeight<contentHeight ? (false) : (true);
blanckDown._visible = viewHeight<contentHeight ? (false) : (true);
upButton._visible = viewHeight<contentHeight ? (true) : (false);
dragButton._visible = viewHeight<contentHeight ? (true) : (false);
downButton._visible = viewHeight<contentHeight ? (true) : (false);
_parent.drag._visible = viewHeight<contentHeight ? (true) : (false);
_parent.down._visible = viewHeight<contentHeight ? (true) : (false);
_parent.scroll_bg._visible = viewHeight<contentHeight ? (true) : (false);
if (incDelay<0) {
dragButton._y = dragButton._y-inc;
if (dragButton._y<buttonSize) {
dragButton._y = buttonSize;
}
if (dragButton._y>buttonSize+scrollHeight-dragButtonHeight) {
dragButton._y = buttonSize+scrollHeight-dragButtonHeight;
}
}
incDelay--;
contentHeight = heightCorect ? (scrollContent.height) : (scrollContent._height);
scrollHeight = viewHeight-buttonSize*2;
dragButtonHeight = viewHeight<contentHeight ? (viewHeight*scrollHeight/contentHeight) : (scrollHeight);
dragButton._yscale = dragButtonHeight;
downButton._y = buttonSize+scrollHeight;
pageDownButton._y = dragButton._y+dragButtonHeight;
pageDownButton._yscale = scrollHeight-dragButtonHeight-dragButton._y+buttonSize-scrollPos;
pageUpButton._yscale = dragButton._y-buttonSize;
if (dragButtonIsDraging) {
//stopDrag();
//startDrag(dragButton, false, 0, buttonSize, 0, buttonSize+scrollHeight-dragButtonHeight+1);
}
if (dragButton._y>buttonSize+scrollHeight-dragButtonHeight) {
dragButton._y = buttonSize+scrollHeight-dragButtonHeight;
}
newY = (dragButton._y-buttonSize)/dragButtonHeight*viewHeight;
vY = vY+(curY-newY)/scrollStep;
vY = vY*speedDec;
curY = curY-vY;
scrollContent._y = Math.floor(-curY+_y);
}
onClipEvent (enterFrame) {
if (_parent.down_but == true) {
with (_parent.scroll) {
if (dragButton._y<buttonSize+scrollHeight-dragButtonHeight-_parent.step) {
dragButton._y = dragButton._y+_parent.step;
} else {
dragButton._y = buttonSize+scrollHeight-dragButtonHeight;
}
}
}
if (_parent.drag_but == true) {
if (_parent.scroll.dragButton._y>_parent.step) {
_parent.scroll.dragButton._y = _parent.scroll.dragButton._y-_parent.step;
} else {
_parent.scroll.dragButton._y = 0;
}
}
}
Reply With Quote
  #2 (permalink)  
Old 06-15-09, 01:19 PM
SD Designs SD Designs is offline
New Member
 
Join Date: Jun 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
nevermind, im a dweeb, i figured out my mistake!
Reply With Quote
  #3 (permalink)  
Old 07-21-11, 02:29 PM
Whatwwd Whatwwd is offline
New Member
 
Join Date: Jul 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Change?

If you don't mind me asking what did you do to make it work?
Reply With Quote
Reply

Bookmarks

Tags
bar, flash, scripts, scroll, text


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scroll to bottom of div with JavaScript kaceykeleher JavaScript 2 04-08-09 04:03 PM
css problem with the scroll bar crazy.works CSS 0 11-04-08 05:34 PM
Scroll Pane and Expanding Tree omniman Flash & ActionScript 4 12-09-06 06:34 PM
Scroll bars help!!!!! afiltroi Visual Basic 1 10-09-06 02:24 PM
JavaScript Scroll help... Thomas82 JavaScript 1 04-30-05 08:42 AM


All times are GMT -5. The time now is 06:42 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.