View Full Version : scroll question
Hi
I have this fla, which I made a scroll for a movie clip. I'd like this scroll to calculate the MC height, so the scroll will work correctly for the MC height.
bt_down.onPress = function() {
texto._y -= 20;
};
bt_up.onPress = function() {
texto._y += 20;
};
I think I have to add just an If statement to this script, right?
CyanBlue
03-07-2003, 07:17 PM
Howdy...I'd like this scroll to calculate the MC heightWhy do you need to calculate the height of the movieclip??? You can use _height property to get the value of it... and use that within the if statement to get the maximum place where you can scroll to...
This is exactly what i need:
...use the _height property to get the value of it... and use that within the if statement to get the maximum place where you can scroll to...
I just don't know how to put this in actionscript.
Ricod
03-07-2003, 11:26 PM
_root.amountvisible = 300;
_root.maxScroll = amountVisible - _root.myMc._height;
_root.startPos = _root.myMc._y;
function findScrollMax(){
var posDiv = _root.myMc._y - _root.startPos;
var maxScrollUp = posDiv;
var maxScrollDown = _root.maxScroll - posDiv;
}
This is on a 1:1 basis ofcourse. (if the scrollbar is just as big as the picture ... it's probably not, so you probably wanna convert it to percentages. Did you happen to have read the tutorial on scrollbars ?)
No, but I'm gonna read
Thanks for your help.
[]'s
Ricod
03-08-2003, 04:52 AM
I think the tutorial will help you out a lot. It has the whole thing written out and explained whats doing what. Very constructive ! You just need to change the .maxlines with pixels instead, using the _height property.
*My little piece of code might not even work properly (looking at it now, it probably doesn't)*
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.