[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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Reloading Dynamic Text
you may need to include a random digit to prevent caching especially if mid is the same value each time the function attempts to load the php page. var rand:Number = Math.floor(Math.random() * 100) loadVariablesNum(live_flash.php?mid=+mid+r=+rand, 0, GET); On Apr 19, 2008, at 12:43 PM, Scott Wilhelm (HireAWebGeek.com) wrote: 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Reloading Dynamic Text
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 = 1; 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: flashcoders@chattyfig.figleaf.com 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
RE: [Flashcoders] Reloading Dynamic Text
The variable textbox are both named t1s. The value of t1s is a number. You can see it at http://www.thextremepaintballleague.com/live_beta/live.php?mid=434 (it's the team on the left's score). -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gabino Travassos Sent: Saturday, April 19, 2008 9:15 PM To: Flash Coders List Subject: Re: [Flashcoders] Reloading Dynamic Text What does the variable t1s look like? I notice that the text box is also called t1s. - Original Message - From: Scott Wilhelm (HireAWebGeek.com) [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Saturday, April 19, 2008 1:43 PM 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Reloading Dynamic Text
What does the variable t1s look like? I notice that the text box is also called t1s. - Original Message - From: Scott Wilhelm (HireAWebGeek.com) [EMAIL PROTECTED] To: flashcoders@chattyfig.figleaf.com Sent: Saturday, April 19, 2008 1:43 PM 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Reloading Dynamic Text
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, 1); // 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 = 1; 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: flashcoders@chattyfig.figleaf.com 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 Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders