wicky
play thing
I'm pretty new to actionscript, and I can't quite work out why this is only partially working. Can anybody help me?
This script is supposed to make a text box continuously scroll, as long as the button is pressed, "scrollUp" works OK, but "scrollDown" isn't doing anything.
(MX 2004)
SCRIPT ------------------------------------------
var srcollDirection:String;
// scroll buttons start
this.scrollDown.onPress = function() {
scrollDirection = "down";
scrollText();
}
this.scrollDown.onRelease = function() {
delete _root.onEnterFrame;
}
this.scrollDown.onReleaseOutside = function() {
delete _root.onEnterFrame;
}
this.scrollUp.onPress = function() {
scrollDirection = "up";
scrollText();
}
this.scrollUp.onRelease = function() {
delete _root.onEnterFrame;
}
this.scrollUp.onReleaseOutside = function() {
delete _root.onEnterFrame;
}
function scrollText () {
_root.onEnterFrame = function () {
if (srollDirection == "down") {
loadedText.scroll -= 1;
} else if (scrollDirection == "up") {
loadedText.scroll += 1;
}
}
}
// scroll buttons end
/ SCRIPT ------------------------------------------
Thanks in advance
This script is supposed to make a text box continuously scroll, as long as the button is pressed, "scrollUp" works OK, but "scrollDown" isn't doing anything.
(MX 2004)
SCRIPT ------------------------------------------
var srcollDirection:String;
// scroll buttons start
this.scrollDown.onPress = function() {
scrollDirection = "down";
scrollText();
}
this.scrollDown.onRelease = function() {
delete _root.onEnterFrame;
}
this.scrollDown.onReleaseOutside = function() {
delete _root.onEnterFrame;
}
this.scrollUp.onPress = function() {
scrollDirection = "up";
scrollText();
}
this.scrollUp.onRelease = function() {
delete _root.onEnterFrame;
}
this.scrollUp.onReleaseOutside = function() {
delete _root.onEnterFrame;
}
function scrollText () {
_root.onEnterFrame = function () {
if (srollDirection == "down") {
loadedText.scroll -= 1;
} else if (scrollDirection == "up") {
loadedText.scroll += 1;
}
}
}
// scroll buttons end
/ SCRIPT ------------------------------------------
Thanks in advance