Groups | Blog | Home
all groups > flash actionscript > april 2004 >

flash actionscript : scrolling text does not work.


chesto
4/29/2004 10:51:04 PM
Could someone please tell me what is wrong with my set up:

1- A layer with a scrollbar as a movieclip
2- A layer with dynamic text box with variable name and instance name
3 - An action layer


1- Code attached to the scrollbar movieclip
[h]
onClipEvent(load){
left = _x;
right = _x;
top = _y;
bottom = _y+146;
max = _root.mytext.maxscroll;
}

onClipEvent(enterFrame){
newpos = max - (((bottom - _y) / 146) * max);
oldpos = _root.mytext.scroll;
_root.mytext.scroll = math.round(oldpos + ((newpos - oldpos) / 2));
}

on (press){
startDrag("", false, left, top, right, bottom);
gotoAndPlay(1);
}

on (release){
stopDrag();
gotoAndPlay(8);
}
[/h]



2 - Dynamic text box has variable name tajtext and instance name mytext

3 - Action layer has this code

[h]
loadVariablesNum("content/intro.txt",0);
_level0.onData = function() {
//scrollnews.html = true;
mytext.text = this.tajtext;
};
[/h]

text file is this:

tajtext=Recommended by F........

Nothing works, I mean the file loads but will not scroll. I need help.
Dinghus
4/29/2004 10:54:55 PM
It may not know what you mean by
left = _x;

What "_x"?

AddThis Social Bookmark Button