all groups > flash actionscript > november 2006 >
You're in the

flash actionscript

group:

scrolling text


scrolling text Sabbathacker
11/13/2006 9:41:17 PM
flash actionscript: I have a textbox instance named "myText"
In an AS layer I have:

---------cut----------
myText.text = "Whatever I want my text to be...";
---------cut----------

So that works just fine. Is there a way to scroll the text from right to
left? Am I on the right track?
I can make it a mc and animate it, but with a large amount of text, that
changes almost daily, its a pain in the arse!

Any advice would be great!
Thanks
Re: scrolling text Ankur Arora
11/14/2006 12:00:00 AM
Make a movie clip instance name my_mc and registration point should be
"top-left".
Place this Movie Clip on Stage and write the below code on frame actions of
root time line.


var scrlSpeed:Number = 1;
my_mc._x = Stage.width;
my_mc.my_txt.autoSize = "left";
my_mc.my_txt.htmlText = "Any long <b>html</b> text can come here in this text
field.";
setInterval(function () {
my_mc._x -= scrlSpeed;
if ((my_mc._x+my_mc._width)<-10) {
my_mc._x = Stage.width;
}
}, 10);
Re: scrolling text sbryner
11/14/2006 3:45:00 AM
I'd look into attaching a UIscrollBar component. Drag it from the components
window to the stage then in the parameters you link it to the text box using the
_targetInstanceName.

so _targetInstanceName = myText // your text box instance name.

then horizontal = true // instead of false;

try dragging the component around the text box as well to see what will happen.
but in order for it to scroll the text it must be attached "linked" to your
text box instance.

hope this helps.

sky



Re: scrolling text Sabbathacker
11/14/2006 4:08:22 PM
Thanks Ankur! Did you write that off the top of your head or clip from somewhere online?

AddThis Social Bookmark Button