chuckdesign
Technical User
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);
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);