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

Posted on 2006-07-05
Last Modified: 2006-11-18
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?
Question by:grzegorczyk
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
LVL 14

Expert Comment

ID: 17043594
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?

Author Comment

ID: 17044394
would contstant interval slow down the app at all? code examples would be awesome, especially quarrying server side...


LVL 14

Expert Comment

ID: 17044789
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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 17044937
Server is .NET most written in C#
LVL 14

Accepted Solution

dfu23 earned 250 total points
ID: 17045933
In ASP.NET page (.aspx) you could use System.IO.FileInfo ( 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 ...

Author Comment

ID: 17046455
Excellent, thanks a lot.
LVL 14

Expert Comment

ID: 17047505
No problem ... best of luck with your project!

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question