Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make scrolling text

Status
Not open for further replies.

chuckdesign

Technical User
Sep 21, 2001
79
US
I am trying to build a tickertape in Flash MX 2004 that would crawl along the bottom of a page. (I'm doing it in Flash, not DHTML, because I want it to be in a certain font, not generic HTML text.)

I have a rather long list of words that need to crawl along the screen, and then it needs to loop seamlessly back to the beginning, infinitely. The code at the bottom of this message, which is based on something I found at Flashkit.com, is supposed to do just that.

The text does loop, but I find that the scroller always stops dead as soon as the first word reaches the far left edge of the text box. In my example, it happens when the word “Advertising” appears for the *second* time in the loop.

You can see how it performs at:

Can anybody recommend what I might do to this code to get it to work? Or recommend an alternate means of getting this technique in Flash?

Thanks.

FRAME 1:

on(rollOver){
stop();
}
on(rollOut){
play();
}
on(press){
// 0=true/false toggle
// 1=work/work.html
// 2=parent
var arr=cat.split("~");
if(arr[0]=="true"){
getURL(arr[1],arr[2]);
}
}

FRAME 2:

if(delayFlag==false){
if(scroller.length>=view){
scroller.text=scroller.text.substr(1,view-1);
}
scroller.text+=theText.charAt(last);
delayFlag=true;
}

FRAME 3:

if(delayFlag==true){
if(getTimer()>=sDelay){
var sDelay=int(getTimer()) + int(sParam);
delayFlag=false;
if(last<theText.length){
last++;
}else{
last=0;
}
gotoAndPlay(2);
}
}
gotoAndPlay(2);
 
Oldnewbie,

Apparently I need Flash Professional to edit the ActionScript file for this ticker. I have regular Flash MX 2004 (and I don't know anybody with Professional.) Do you have any suggestions?

Thanks,
Chuck



-- Chuckdesign :)
 
I think those .flas might be MX2004 files as opposed to MX only ones (I'm on MX only), but I don't think it makes any difference if you're on MX2004 or MX2004 professional, you should be able to open them.

If not what I do is asked someone on actionscript.org ( - which is not an archaic forum like these ones, where you can edit your posts or attach any files!) to convert it to a MX only format, and most of them then open up fine.

Regards. Affiliate Program - Web Hosting - Web Design
After 25,000 posts, banned on FK, but proud not to have bowed down to them!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top