Groups | Blog | Home
all groups > flash actionscript > february 2007 >

flash actionscript : scrolling text


superdk
2/21/2007 4:32:48 PM
I have a dynamic text box in a movieClip, which is placed on the main time
line. I'm trying to get the text to scroll continuously with buttons. To see
site go to www.porsche356.org.uk - history page.

The code is placed on the firstframe of movie clip.
here's the code i'm using:

this.downBtn.onPress = function() {
_root.onEnterFrame = function() {
this.historyText_mc.loadedInfo.scroll ++;
}
this.downBtn.onRelease = function () {
_root.onEnterFrame = undefined;
}
}
this.upBtn.onPress = function () {
_root.onEnterFrame = function () {
this.historyText_mc.loadedInfo.scroll --;
}
this.upBtn.onRelease = function() {
_root.onEnterFrame = undefined;
}
}

'loadedInfo' is name of dynamic text box -
'history_mc' is the name of the movieclip which is placed on main time line.

Thanks for any help,
Dave
kglad
2/21/2007 4:42:21 PM
superdk
2/21/2007 4:51:15 PM
the code I'm using now, which works is -

//this code is attached to the up btn
on (release) {
this.historyText_mc.loadedInfo.scroll-=1;

}
//this code is attached to the down btn
on (release) {
this.historyText_mc.loadedInfo.scroll+=1;

}

I'd like to figure out how to scroll the text , not one click at a time.
kglad
2/21/2007 5:25:57 PM
your post is confusing. you can't use both sets of code and yet you state in
each message, the posted code is the code you're using.

if you want your website to use the code posted in your first message, remove
the code in the 2nd message and add the code in your first message. if you use
the correct instance names, that code will work.
superdk
2/21/2007 7:11:17 PM
Sorry for the confusion, but yes I want the code from the 1st post to work. I
have cleared the code from buttons (2nd message) but still dosn't work.

I'm keeping the code from the 2nd message on the site until I can get the
scrolling continuously script to work.
kglad
2/21/2007 7:32:46 PM
if the first code fails it's because you have an instance name and/or path
problem.

first, place a trace() in one of your onDown handlers and see if they execute
when your button's pressed. if not, give your buttons the correct instance
names. if yes, use trace(this.historyText_mc.loadedInfo) in one of your
onEnterFrame handlers to see if you have the correct path/name to your
textfield.
AddThis Social Bookmark Button