To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Reply
 
Thread Tools Search this Thread Display Modes
Old 11-08-2006, 11:42 AM   #1
hansverst
Member
 
Join Date: Mar 2003
Location: Netherland
Posts: 33
interval to update

Hello,
i have a question, i try a lot but how can i simple update from a url?
I use a simple perl file that sends data (text) separated ' ; ' for every new line (for the test it shows local time and ip)
I try the code below local, and it updates it self nice, so every 5 sec i saw new updated text.
But when i use the url from the hosted server it only loads ones, then only it repeat his own text in message.text.
Is there a way to to get this right ?
Thank you,
Hans

/ *** create output field ***

myTextFormat = new TextFormat();
myTextFormat.font = "Verdana, Helvetica";
myTextFormat.size = 12;
myTextFormat.color = 0x000000;

createTextField("message",1,23,49,564,258);
message.border = false;
message.background = false;
message.multiline = true;
message.wordwrap = true;
message.scrolbar = true;
message.setNewTextFormat(myTextFormat);

lv = new LoadVars();

update= function (){
lv.load('http://www.screensave.nl/get.pl');
}

lv.onData = function(src){
records = src.split(';');
for (var b = 0; b < records.length; b++){
message.text=message.text+records[b]+'\n';
}
}

setInterval(update, 5000);
update();
__________________
hansverst is offline   Reply With Quote
Old 11-08-2006, 11:59 AM   #2
swrzzzz
Steve R
 
swrzzzz's Avatar
 
Join Date: Jan 2005
Location: Leicestershire,UK
Posts: 195
its not necessarily the problem, but sometimes things get cached.

When I read dynamic data I always put

"?random="+math.random()

at the end of the url. This makes the browser think you are asking for a response and makes it make a new request each time

Steve
swrzzzz is offline   Reply With Quote
Old 11-09-2006, 06:09 AM   #3
hansverst
Member
 
Join Date: Mar 2003
Location: Netherland
Posts: 33
re:

Hello swrzzzz,
thanks for your answer.
I did try to put the code at the end of the url, you wrote but still not working well, so i try this code now, and now it update great.
i don't know if this is a good one to use to update data but i think it is.
Thank you,
Hans

update= function (){

_root.loadVariables("http://www.screensave.nl/get.pl", "POST");
records = i.split(';');

for (var b = 0; b < records.length; b++){
message.text=message.text+records[b]+'\n';
}
i = "";
_level0.message.scroll += 15;_level0.dwn = 1;
}

setInterval( update, 3000, );
update();
__________________
hansverst is offline   Reply With Quote
Old 11-09-2006, 07:52 AM   #4
swrzzzz
Steve R
 
swrzzzz's Avatar
 
Join Date: Jan 2005
Location: Leicestershire,UK
Posts: 195
OK

It's cool that you got it working and it was obviously a caching issue.

I just noticed a typo in my reply -it should have been Math.random (capitalised) and it wouldn't have worked if you just copied in the text:-(

Sorry

Steve
swrzzzz is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Product Support > Koolmoves

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:12 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.