somehow i don't think your sendAndLoad is correct. does the value for
mid change at all when the interval is reached?
until then, this code should be able to update the textfield as the
output from the php changes.
function reloadPHP() {
loadVariables(fl_url, _root);
}
rand = Math.floor(Math.random() * 100);
fl_url = "live_flash.php?mid="+mid+"&r="+rand;
// set the intervals for calling the php page
counter = setInterval(reloadPHP, 10000);
// continuous loop to update the textfield from the _root value
this.onEnterFrame = function():Void {
_level0.t1s.text = t1s;
}
On Apr 19, 2008, at 5:46 PM, Scott Wilhelm (HireAWebGeek.com) wrote:
I'm starting to get somewhere. The problem I'm running into is that
the
script will reload so fast for a while, and then it seems to timeout.
Here's my code. Can someone please tell me what I'm doing wrong?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
rand = Math.floor(Math.random() * 100);
fl_url = "live_flash.php?mid="+mid+"&r="+rand;
time = 10000;
counter = setInterval(reloadPHP(), time, "");
function reloadPHP(){
clearInterval(counter);
sendAndLoad(fl_url,"GET");
loadVariables(fl_url, "_root");
counter = setInterval(reloadPHP(), time);
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thanks!
Scott
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Scott
Wilhelm (HireAWebGeek.com)
Sent: Saturday, April 19, 2008 3:43 PM
To: [email protected]
Subject: [Flashcoders] Reloading Dynamic Text
Hello:
I'm trying to update a dynamic text field that is being loaded with
variables brought in from a php file loaded in within a setinterval
function...for some reason though, it will not update the text
field, even
though I have the it in the function...I'm, using AS2...
This is the script I have so far:
setInterval(updatescoreboard(), 1000, "");
function updatescoreboard() {
loadVariablesNum("live_flash.php?mid="+mid, 0, "GET");
_level0.t1s.text = t1s;
}
Any ideas/suggestions to get this to work?
Thanks,
Scott
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders