Flash, xml and real-time? Detecting XML file changes without reloading

I'm trying to build an app that will know when an xml file has changed. This means that I am viewing a website and flash displays the changes without me refreshing the browser. I guess I need to know when an xml file has changed. What's the best way of approching this? XMLSocket?

Thanks in advance?
grzegorczykAsked:
Who is Participating?
 
dfu23Connect With a Mentor Commented:
In ASP.NET page (.aspx) you could use System.IO.FileInfo (http://msdn2.microsoft.com/en-us/library/system.io.fileinfo_members.aspx) to check the last write time ...

Call this however many seconds apart and keep track of the timestamp that is returned ... if it changes, reload your XML. I think that LoadVars is the best way to call the ASP.NET page ...

http://www.sephiroth.it/tutorials/flashPHP/loadVars/
0
 
dfu23Commented:
XMLSocket could do it but it is probably more hassle than what you are looking for ... because you must also implement a socket server application that you could communicate with. There are simpler ways of accomplishing what you want.

I think it is the LoadData functionality ... right? You can call a server side function (PHP, ASP, etc.) and check the modified date/time stamp of the file in question. If the date is newer than what you have then reload the XML document.

You can setup an interval to poll this every few seconds/minutes and dynamically refresh the data when needed.

Do you need some code examples? Specific questions?
0
 
grzegorczykAuthor Commented:
would contstant interval slow down the app at all? code examples would be awesome, especially quarrying server side...


Thanks,

k
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
dfu23Commented:
First off ... what server side functionality do you have (ASP, PHP, ASP.NET ...) do you know off-hand?

A constant interval would not slow you down at all unless you were doing it very frequently (like polling more than once a second) and the amount of data being returned was large ... I think what you want will not hinder your application at all.

Let me know what capabilities your server has and we'll go from there.
0
 
grzegorczykAuthor Commented:
Server is .NET most written in C#
0
 
grzegorczykAuthor Commented:
Excellent, thanks a lot.
0
 
dfu23Commented:
No problem ... best of luck with your project!
0
All Courses

From novice to tech pro — start learning today.