all groups > flash actionscript > june 2005 >
You're in the

flash actionscript

group:

Stupid Text!!!


Stupid Text!!! empiric3
6/28/2005 9:02:13 PM
flash actionscript:
I am attempting to create a scrolling marquee for our company intranet, that
can be updated from a external text file. I have accomplished both reading from
the text file, and getting the scrolling marquee to work, but when I combine
the two, the marquee will not scroll. Here is my code...

s_text.autoSize="left";
loadVariables("scroll_text.txt",this); //if I comment this line out, it will
run just fine, but obviously the dynamic text doesn't load
var startPos=663; //start position of the text in the marquee... will reset
the text when the end is reached

_root.onEnterFrame = function() {
s_text._x = s_text._x - 2;
t_width.text = s_text._x;
if (s_text._x <= (-5 - s_text._width)) {
s_text._x = startPos;
}
}

Any ideas? I'm sure I am just missing something stupid. I just want my dynamic
text to scroll... thanks! You can email me directly at
spagenstecher@limefinancial.com.
Re: Stupid Text!!! subsomatic
6/28/2005 9:24:30 PM
thought i'd take a stab at this:

loadVariables("scroll_text.txt",this);

var startPos = 600;
textbox._x = startPos;

_root.onEnterFrame = function() {
textbox._x -= 10;
if (textbox._x <= (5-textbox._width)) {
textbox._x = startPos;
}
};


code seems to work.
remember to embed your font. that was causing me some trouble for a bit. the
instance name of my textbox is (aptly named) textbox and you need to put the
variable name of the text your importing in scroll_text.txt in the var name of
the textbox.

hope that works!
Re: Stupid Text!!! empiric3
6/28/2005 10:07:04 PM
Re: Stupid Text!!! forumnotifier
6/28/2005 10:07:08 PM
AddThis Social Bookmark Button