updating flash from a dynamically changing XML file

Ask a Question related to Macromedia Flash Data Integration, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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....
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

  6. #5

    Default 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

  7. #6

    Default 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

  8. #7

    Default 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

  9. #8

    Default 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

  10. #9

    Default 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

  11. #10

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139