A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: cs4 URLLoader reset? xml question

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    1

    cs4 URLLoader reset? xml question

    I am very new to flash and trying to learn to read and parse XML files.

    it seems to work really elegantly except I have an issue with what seems to be caching that makes it hard to check my work.

    Code:
    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();
     
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
     
    xmlLoader.load(new URLRequest("http://www.somedomain.com/flashtest/list.xml"));
     
    function LoadXML(e:Event):void {
    xmlData = new XML(e.target.data);
    trace(xmlData);
    }
    this works fine to load and trace the list.xml file on my server, however, if i edit list.xml, and then hit ctrl-enter to rerun the swf, the changes are not reflected in the program. in fact, i can delete list.xml off the server and it keeps tracing the the file that was originally loaded.

    i have to actually close out my .fla file and reopen it to get it to update.

    i am sure there is something silly i am missing but i have been messing with it for hours.

    thanks for any help

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Try this. It will prevent caching:

    var URL:String="http://www.somedomain.com/flashtest/list.xml";

    if (Capabilities.playerType != "External" && Capabilities.playerType != "Standalone")
    {
    URL+= "?" + new Date + Math.floor(Math.random() * 10000);
    }
    - The right of the People to create Flash movies shall not be infringed. -

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center