icube
July 21, 2004, 2:18pm
1
i’m using this tutorial to make my dynamic scroll text in flash mx… i din choose to use the inbuilt flash mx component because i wanted a custom one…
the thing is… how do i click and hold on my down/up button and the text continue scrollling…
i tried changing the tutorial code
on (press, release, keyPress "<Up>")
to
on (press)
and it doesn’t work…
please advice me what to do… thanks…
system
July 21, 2004, 2:47pm
2
I usually do mine similar to this. Put this code on the timeline and give your buttons the instance name of ‘up’ and ‘down’ and name your text box ‘textbox’
up.onPress = up.onDragOver = function() {
pressing = true;
movement = -1;
};
up.onRelease = up.onDragOut = function() {
pressing = false;
};
down.onPress = down.onDragOver = function() {
pressing = true;
movement = 1;
};
down.onRelease = down.onDragOut = function() {
pressing = false;
};
_root.onEnterFrame = function() {
if (pressing == true) {
textbox.scroll = textbox.scroll+movement;
}
};
system
July 21, 2004, 3:34pm
3
if you’re using a high frame rate…this would work better:
scrollUp = function () {
contentText.scroll--;
};
scrollDown = function () {
contentText.scroll++;
};
//down
down.onPress = function() {
scrollDown();
scrollTextDown = setInterval(scrollDown, 100);
};
down.onRelease = down.onDragOut=function () {
clearInterval(scrollTextDown);
};
//up
up.onPress = function() {
scrollUp();
scrollTextUp = setInterval(scrollUp, 100);
};
up.onRelease = up.onDragOut=function () {
clearInterval(scrollTextUp);
};