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

flash actionscript : How can I do this every 2 seconds?


trints
3/6/2004 8:09:43 PM
var dateVars = new LoadVars();
dateVars.onLoad = function(ok) {
if (ok) {
date_txt.text = "High Bid $"+dateVars.day+" Bidder: "+dateVars.month;
}
};
dateVars.load("http://trinity/tribidz/highbid.txt");

Any help is appreciated.
Thanks,
Trint
Dinghus
3/6/2004 8:31:26 PM
Another question asks the same thing. You need to do an onEnterFrame so it just
keeps repeating. To time delay you can send it to another frame where a script
delays for 2 seconds and then sends it back to the original frame.
trints
3/6/2004 8:42:59 PM
stwingy
3/6/2004 8:43:30 PM

function loading() {
dateVars.load("http://trinity/tribidz/highbid.txt");
}
setInterval(loading, 2000);

jerreye04
3/6/2004 8:43:41 PM
I think this will do it:

function loadTheVars() {
var dateVars = new LoadVars();
dateVars.onLoad = function(ok) {
if (ok) {
date_txt.text = "High Bid $"+dateVars.day+" Bidder: "+dateVars.month;
}
};
dateVars.load("http://trinity/tribidz/highbid.txt");
}
loadVarsInt = setInterval(loadTheVars, 2000);

trints
3/6/2004 8:52:29 PM
I do not have a second frame, and this is doing everything as the original except for about 2 seconds it says:
_level0.date_txt

help is appreciated,
Thanks,
malspach
3/6/2004 9:00:44 PM
to put in a frame 2 just right click where the second frame would be on the
timeline and select insert frame, then you could try adding what they had said,
and then add goto.frame1 to it, maybe that would help, im unsure :| but it may
be worth a thought, i been here pounding my head for hours just getting a
textbox to display its external text file :(
stwingy
3/7/2004 1:07:02 AM
if you carry on doing multiple posts for exactly the same thing, you will stop
people from replying. The code i gave you for one frame is ok and if you
copy/paste Kglads code (in one of your other posts) it will work fine.
trints
3/7/2004 2:20:24 AM
ok, thanks,
AddThis Social Bookmark Button