A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: (AS2) - Loading a SharePoint XML data into flash

  1. #1
    Senior Member hts5000's Avatar
    Join Date
    Oct 2007
    Posts
    160

    (AS2) - Loading a SharePoint XML data into flash

    I was hoping someone could help me out here. I am trying to read XML data from a SharePoint site. The issue I am having is that the flash project works just fine when I preview the swf in flash, however when I try to view it in HTML it does not load the XML file.

    Now the XML file is not a simple document that can live in the same folder as the swf. I have to use a link to a web page. This is the code that I am using (sorry. had to change the web address)

    Actionscript Code:
    var testXML:XML = new XML();
    testXML.ignoreWhite = true;
    testXML.onLoad = function(success) {
        if (!success) {
            trace("testXML did not load");
        } else {
                    trace("testXML loaded");
            }
    }
    testXML.load("http://sharepoint.com/sites/divisions/workgroups/_vti_bin/owssvr.dll?Cmd=Display&List=C3250E8A-148A-4310-800E-E21AEC253338&XMLDATA=TRUE");

    Can someone tell me if I am doing something wrong? Any help would be greatly appreciated.

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    I cant seem to get the XML to work anywhere..local or live..

    says connection closed.

    that being said.. I have no experience with Sharepoint..

    if an XML file is loading when testing locally,..but not through HTML/live.. it usually means there is no crossdomain.xml policy in place

  3. #3
    Senior Member hts5000's Avatar
    Join Date
    Oct 2007
    Posts
    160
    Thanks Whispers for your reply. Unfortunately even if I did post the correct link you would not have been able to open it as it’s an internal address only.

    So just to be clear when it does and doesn’t work. If I am in CS3 and press ctrl+enter the xml loads just fine. If I double click on the swf from within a folder on my desktop it doesn’t load.

    Now I am by no means an xml expert. So what do you mean by crossdomain.xml policy? Is this something that I can fix in the swf or does it have to live in the xml file?
    Last edited by hts5000; 04-13-2011 at 11:27 AM. Reason: spelling

  4. #4
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,756
    a crossdomain.xml policy is an .xml file, named crossdomain.xml

    it sites on the server that 'hosts' the XML file..

    this allows certain domains/computers to access their XML data file and use it.. where otherwise it would ONLY be usable by projects on the same domain/server..

    things like Yahoo! or weather channel .etc have an XML feed that is available for PUBLIC use..

    they normally have a crossdomain.xml policy in place to allow outside people to access this feed.

    its all security stuff.

    anyways..

    the most generic crossdomain.xml policy looks like this:

    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <allow-access-from domain="*" />
    </cross-domain-policy>


    allows everyone access to the data feed.

  5. #5
    Senior Member hts5000's Avatar
    Join Date
    Oct 2007
    Posts
    160
    Thanks Whispers for the great information. I will look into that.

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