dcsimg
A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: XML and flash connection problems

  1. #1
    Senior Member
    Join Date
    Mar 2001
    Location
    Manchester
    Posts
    102

    XML and flash connection problems

    I have a html page on the root containing a flash file which queries the content from an XML file. The flash and xml files are contained within a folder adBanner. For some reason when the page loads the Flash file fails to connect with the XML file to populate the data. If all the files reside on the root it works ok however its not really practical to have them in that file structure.

    The weird thing is that when locally previewing, it works ok, its only when its uploaded to the server than problems seem to occur. Any help would be greatly appreciated. BY the way, all the files are on the same webserver.

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    what path is the flash file calling to load the xml file? and also have u tested it locally within a browser or within the flash testing environment?
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Location
    Manchester
    Posts
    102
    Ive tested it locally within a browser environment and works fine. Does the XML file have to sit at the same level as the HTM(L) and .swf file? Ive tried changing the onLoad path in flash for the xml adBanner/adBannerContent.xml but the page just hangs or the actionscript initiates without content for the XML file.

    Is this a security feature within flash player that prevents reading/displaying from a different path? I know there can be problems if the XML file is on a different server but dont understand why mine isnt working.

    Matt

  4. #4
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    Try setting the xml file path relative to the HTML file, not the swf file and see if that makes a difference. Usually i just keep the swf, html page and xml in the same directory so no issue occurs.
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  5. #5
    Senior Member
    Join Date
    Mar 2001
    Location
    Manchester
    Posts
    102
    Yeah that solution would be simpler but unfortunately the client wanted them to sit neatly in a folder. Ive tried making the paths relative but it doesnt seem to make much difference.

  6. #6
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    I always find i have to make it relative to the HTML file containg rather than the swf itself.

    So for e.g suppose you have a folder called 'FLASH' within the ROOT folder.

    Suppose the ROOT folder contains the HTML file and the FLASH folder contains the swf and xml file.

    Then the xml will be loaded as follows (even though the swf and xml file are in the same folder):

    myXML.load("flash/somefile.xml");
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  7. #7
    Senior Member
    Join Date
    Mar 2001
    Location
    Manchester
    Posts
    102
    Slient, yeah that works fine locally but on uploading to a server the swf doesnt seem to want to connect to the data source.

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