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
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);
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
Thanks Ankur! Did you write that off the top of your head or clip from somewhere online?
Don't see what you're looking for? Try a search.
|