Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
levrek1 #1
updating flash from a dynamically changing XML file
Creating a non-interactive status display: I want to have the flash display
reflect data in a server-based XML-file. So far this is easy. But I want the
display to change everytime the XML file changes-- in order to reflect status
changes. I've used an XMLConnector and specified it and the trigger in the
first frame. The Flash code catches and shows the XML values initially . But
when I edit the XML file, the new values are never picked up by Flash- its
almost as though the values are cached. How do I get Flash to regularly be
updated from a changing XML file? I've also tried putting the trigger in a
loop- but that doesn't work either.
levrek1 Guest
-
Updating Updating site map or archive dynamically
Hi there! ;-) Posted in Site Design as well.... Anyone know if there is a way to use Contribute to automatically/dynamically update a site map... -
Updating and XML file through Flash?
Hi All I have an interface with two textfields and a combobox or a list. I want a user to be able to select a subject in the combobox and to input... -
Updating an XML file with Flash
Hi, I have just been going trough the sample application "Bike Trips Sample" Using the XMLConnector Component to upload and navigate an xml file.... -
Updating a DataAdapter, DataGrid after changing the database
I currently have a page which displays data in a DataGrid from a DataSet filled by an OleDbDataAdapter. It also has buttons to carry out events... -
changing cursor in MX when used with flash swf file
In my director mx project I have a number of imported flash mx files. One of these is a colouring in book where the cursor is replaced with a... -
MotionMaker #2
Re: updating flash from a dynamically changing XML file
Try adding a random value to the load method argument. You might use "my.xml?" + getTimer() or you can use something more savy with the Math.random in combination with getTimer().
MotionMaker Guest
-
Scott Johnson #3
Re: updating flash from a dynamically changing XML file
What does that do, force the page to regenerate itself, preventing the
cached page from loading?
MotionMaker wrote:> Try adding a random value to the load method argument. You might use "my.xml?" + getTimer() or you can use something more savy with the Math.random in combination with getTimer().Scott Johnson Guest
-
MotionMaker #4
Re: updating flash from a dynamically changing XML file
Reply to your email
Sorry I missed you are using the XMLConnector component. Have no real
experience with the XMLConnector to advise you on caching issues. But with the
XML object, the load method file name argument is often appended with a time
value to help fool the cache. Perhaps you can find a similar solution.
MotionMaker Guest
-
levrek1 #5
Re: updating flash from a dynamically changing XML file
I DID find a solution with setInterval, but there is still a problem of a
diffeent sort.
When using XMLConnector, it appears that XMLConnector.trigger() is the thing
that goes out and gets new data from the server. so:
function checkForData():Void {
myXML.trigger();
<<handle new values of bound data>>
};
var intervalID:Number = setInterval(checkForData, 10000);
works very well by executing the trigger every 10000 timeunits. This all
works when run in the Flash Player. However, if I embed the thing in a webpage
(with either FireFox or IE7 or 6), It stops triggering after the first time.
Interestingly if I also run the Flash Player version, then the web version
keeps updating, but stops if I kill the Player. So, I'm wondering: whats up
with this?
levrek1 Guest
-
MotionMaker #6
Re: updating flash from a dynamically changing XML file
Again not up-to-date on XMLConnector but common sense says you cannot handle
external data on the code line following the request for it. Rather there needs
to be a call back function where this happens.
MotionMaker Guest
-
levrek1 #7
Re: updating flash from a dynamically changing XML file
Thanks for your help, but its still not working. The documentation on
XMLConnector never mentions anything about needing a callback function. I
assumed it was handled, somehow, in the component. Nonetheless, I created one
with AddEventListener. I get the event and deal with it. However, just as
before, it seems to work fine in the standalone flash player but not when the
Flash is in a webbrowser- in the browser it checks the data once and gthen
stops. I have tested the setInterval() with a Flash-local function andthe
local ones work fine, so it seems pretty clear that the problem is repeated xml
reads on a remote server from a webbrowser. Can this be made to work??
levrek1 Guest
-
MotionMaker #8
Re: updating flash from a dynamically changing XML file
I see two events in the docs. Perhaps the one you need is [url]http://livedocs.macromedia.com/flash/8/main/00004315.html[/url]
MotionMaker Guest
-
levrek1 #9
Re: updating flash from a dynamically changing XML file
OK, so I found th issue- its the browser. What I have been doing works
perfectly fine in FireFox. However, IE7 (haven't yet tried other IE versions)
seems to do some strange caching or has a security scheme that prevents
repeatedly hitting the same .php file to get data. Its either the browser or
the flash player for IE
levrek1 Guest
-
MotionMaker #10
Re: updating flash from a dynamically changing XML file
Perhaps if you are using AS to work the XMLConnector you can try adding a
random variable to the URL
myXMLConnector.URL = "http://domain/thefile.php?" + getTimer();
Again I do not use XMLConnector, but this is what is frequently done as one
way to overcome caching issues.
MotionMaker Guest



Reply With Quote

