scrolling event: movieclip instead of dynamic text
Hello everybody. I am very very novice to actionscript, so probably my question will sound a little silly.
I am trying to put an arabic text to scroll with a custom scrollbar. So I found a nice video in youtube about doing that with a dynamic text field. It works wonderful for latin characters (left to right and separated letters) but unfortunately not for arabic characters (they don't get connected). Actually, I don't care to use just a movieclip with the text instead of the dynamic text field. But I don't know how to change the actionscript code for the movie clip instead of the dynamic text field.
Here I show you the code for the scrolling text in a dynamic text field (it's a short code), on the stage I got just the dynamic text field (instance name: texto_txt), the scrollBar (a vertical line, instance name: scrollBar_mc) and the scroller itself (a little rectangle, instance name:scrollHandle_mc😞
var content:String = "cjeihfirehjfejlkfjkerjfirjfejifjrijwkjfirwjekñlkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkllllllll";
texto_txt.text = content;
texto_txt.wordWrap = true;
var min: Number = scrollHandle_mc.y;
var max: Number = min +(scrollBar_mc.height - scrollHandle_mc.height);
var intervalo: Number = max - min;
var arrastrando: Boolean = false;
var bounds: Rectangle = new Rectangle (scrollHandle_mc.x, scrollHandle_mc.y, 0, scrollBar_mc.height - scrollHandle_mc.height);
scrollHandle_mc.addEventListener (MouseEvent.MOUSE_DOWN, arrastrandoScroll);
stage.addEventListener (MouseEvent.MOUSE_UP, stopIt);
function arrastrandoScroll(mouseEvent:MouseEvent)
{
scrollHandle_mc.startDrag(false,bounds);
arrastrando = true;
scrollHandle_mc.addEventListener(Event.ENTER_FRAME, progress);
}
function stopIt(mouseEvent:MouseEvent)
{
scrollHandle_mc.stopDrag();
arrastrando = false;
}
function progress(e:Event)
{
var moverScroll:Number = scrollHandle_mc.y - min;
var percent:Number = moverScroll/intervalo;
if (arrastrando == true)
{
texto_txt.scrollV = percent * texto_txt.maxScrollV;
}
}
What I want to do is clear the dynamic text field and use instead a movieclip (text_mc) that includes already the text, the bounding box would be a mask. How do I change the actionscript? Could anyone help me out?