i made a news ticker…
every 8 seconds it shows a different item
When I click a button and load another movie, and return…
the delay between the newsitems is not 8 sec anymore.
When I do the same, it’s even faster.
clearInterval(newTickerId);
newTickerId = setInterval(myHome.newsTicker,3000);
grtz
system
September 23, 2004, 3:13pm
2
can you give more code, or just the fla?
system
September 23, 2004, 5:39pm
3
Where did you build in the delay of 8 seconds ? The code above just shows the calling of the setInterval, nothing else
system
September 24, 2004, 6:23am
4
Normally I would post the fla, but it’s a project.
But here’s the code:
newTickerId = setInterval(myHome.newsTicker,3000);
myHome.newsTicker = function()
{
clearInterval(newTickerId);
maskNieuws_mc._width=2;
maskNieuws_mc.tween("_width",277,1,"easeInQuart");
if(teller==0)
{
teller=aantalItems;
}
teller--;
var tekst = titelNieuwsArray[teller];
leesMeer_mc.node=teller;
tekst +="<br><br>"
if(introNieuwsArray[teller].length>180)
{
tekst+=introNieuwsArray[teller].substring(0,180);
tekst+="..."
}else
{
tekst += introNieuwsArray[teller];
}
//news_txt.styleSheet=myCss;
news_txt.htmlText=tekst;
news_txt.setTextFormat(homeStijl);
}
Maybe my interval comes in conflict with my tween function (Robert Penner classes)
system
September 24, 2004, 6:26am
5
PS. we kunnen ook altijd verder gaan in het Nederlands hoor…
system
September 24, 2004, 6:41am
6
i have also placed clearInterval(newTickerId); before my setInterval, but that doesn’t work too…
and I replaced the tween function, with my own onEnterframe function
still the same problem…
my setInterval is not in a loop or something like that… just in a function that is called every time the home.swf starts
grtz
system
September 24, 2004, 7:44am
7
i really don’t understand how your fla is set up…
je kan me toevoegen op je msn/icq/yahoo/aol nummers staan in m’n profiel en ik ben tot 5 uur bereikbaar.
system
September 24, 2004, 8:24am
8
my site is built up like this…
I have a menu.swf, that automatically loads my home.swf
HOME.SWF
if(myHome == undefined)
{
_global.myHome = new Object();
}
myHome.build = function()
{
...
clearInterval(intervalID);
intervalID = setInterval(myHome.newsTicker,3000);
}
myHome.newsTicker = function()
{
....
}
myHome.build();
my whole movie is attached to one movie which is on depth 1
And in menu.swf you can click other items, they will load in a contentHolder_mc, just like home.swf
all my code is on one frame
If i change several times between “home” and “over vdb” my setInterval acts weird.
grtz
grtz
system
September 24, 2004, 7:30pm
9
problem solved…
i had the following:
clearInterval(intervalId);
intervalId = setInterval(function, interval);
in one swf, but if you go to another swf, and you return, you can’t delete intervalId because it will be undefined.
So i made a _global.intervalId