interfacer
02-21-2006, 08:03 AM
Ok, so I am attempting to change my textbox's to be continuously scrolling instead of having repeated clicking. Here is my plan:
1. Have two buttons (up_btn, down_btn) and when pressed, the content (content_mc) is scrolled up or down. Pressing the button changes a variable called yDir to +/-1 to control direction.
var yDir:Number =1;
loadMovie("info.swf", "content_mc");
up_btn.onPress = function() {
trace("up_btn button has been hit");
yDir=1;
content_mc.gotoAndPlay(2);
}
up_btn.onRelease = function() {
trace("up_btn button has been released");
content_mc.gotoAndStop(1);
}
down_btn.onPress = function() {
yDir=-1;
content_mc.gotoAndPlay(2);
}
down_btn.onRelease = function() {
content_mc.gotoAndStop(1);
}
2. On the movieClip content_mc, there are three frames. the first frame contains a stop(); function.
this is teh 2nd frame:
trace("frame2");
this._y+=5*_root.yDir;
the 3rd frame of the MC has a 'gotoAndPlay(2);' on it. can anyone tell me why it only happens to play the 2nd frame twice and then does nothing when the buttons are pressed? it does not appear to be moving as well.
is this a bad approach as well? can anyone recommend something simpler if it is?
1. Have two buttons (up_btn, down_btn) and when pressed, the content (content_mc) is scrolled up or down. Pressing the button changes a variable called yDir to +/-1 to control direction.
var yDir:Number =1;
loadMovie("info.swf", "content_mc");
up_btn.onPress = function() {
trace("up_btn button has been hit");
yDir=1;
content_mc.gotoAndPlay(2);
}
up_btn.onRelease = function() {
trace("up_btn button has been released");
content_mc.gotoAndStop(1);
}
down_btn.onPress = function() {
yDir=-1;
content_mc.gotoAndPlay(2);
}
down_btn.onRelease = function() {
content_mc.gotoAndStop(1);
}
2. On the movieClip content_mc, there are three frames. the first frame contains a stop(); function.
this is teh 2nd frame:
trace("frame2");
this._y+=5*_root.yDir;
the 3rd frame of the MC has a 'gotoAndPlay(2);' on it. can anyone tell me why it only happens to play the 2nd frame twice and then does nothing when the buttons are pressed? it does not appear to be moving as well.
is this a bad approach as well? can anyone recommend something simpler if it is?