Results 1 to 4 of 4

Thread: XML Security Sandbox issue? Can't figure this out.

  1. #1
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default XML Security Sandbox issue? Can't figure this out.

    First of all, thanks a bunch to those of you (especially Medyman) who helped me get me first Flash/XML project working a few weeks ago. It was a for a car dealership and you can see it here:

    http://www.futurefordofconcord.com

    Now I am doing a Fleet Vehicles site for the same guys, located here:

    http://www.futurefordofconcord.com/fleet/

    Notice that the Flash piece says "XML Car Data has failed to load. ". Now view the very same swf directly:

    http://www.futurefordofconcord.com/f...s/homepage.swf

    Outside the bounds of the html page, it works just as intended.

    Here's the AS2.0 loading the xml file:

    Code:
    //load homepage.xml
    var carData:XML = new XML();
    carData.ignoreWhite = true;
    carData.onLoad = function(success) {
    	if (success) {
    			m1dtfV.text = "XML Car Data loaded successfully! :)";
    			parseCarData ();
    		} else {
    			m1dtfV.text = "XML Car Data has failed to load. :(";
    		}
    };
    carData.load("homepage.xml");
    I have tried playing around with the location of the homepage.xml file (it is currently resting in the same /images/ directory as the swf itself) and have used both relative and absolute paths to point to the file, but the result is always the same: the file works on its own, but once embedded into the homepage it fails to load the XML.

    That's what makes me think its a security issue, but I don't really get why its happening or how to fix this. Any tips greatly appreciated!

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Yeah, it's definitely a path issue.

    You said you've used absolute paths. But try doing that again, making sure that the .swf isn't cached. Turning browser cache off, either though the internet settings or especially the Fx developer toolbar isn't 100% accurate. The easiest way to ensure that you're not caching is to rename the file.

    Sandbox security issues only occur in local environments, so that's not a factor here.

    If that doesn't work, there might be something server-side going on.

  3. #3
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    From another forum:


    when flash is embeded - "relative" file paths are "relative" to the document it is embeded in.

    should be:
    carData.load("images/homepage.xml");

    You would think that it would be relative to the swf. But, it is not that way by default - you can change that with actionscript, if you choose to. it's easier to understand if you look at a swf as a "client". think of the base url being the same as the browser window - it's typical that a swf is in the same folder as the embed document.


    gl..

    ---

    First of all, thanks for the response.

    I tried using:

    carData.load("images/homepage.xml");

    and unfortunately that doesn't work either. And even still, if the path is relative to the page the swf is embedded in, then the copy of homepage.xml that is sitting in the same folder as the html page should have worked.

    There is a factor in this puzzle that I haven't mentioned, and that is that the movie on the index page is actually a two frame movie that, once the body's onLoad fires, goes to the second frame and uses loadMovie to load up the actual homepage flash file. I didn't think this would be a factor since the movie on the non-fleet homepage works the same way without any problems. But perhaps (due to security reasons?) you can't load XML into an swf that is loaded into another swf unless it is in the .com's most top-level directory?

    If I don't use this step, and just embed the to-be-loaded swf into homepage, everything works fine.

    So for sure, it is not a filepath issue, and for sure, it is related to the fact that the movie calling the XML is loaded into another movie. This setup has no problems in the top level directory, but in the /fleet/ directory the XML data fails to load.

    This has got to be a security issue or a bug. I really like being able to have my movie play only once all the page elements are loaded. ;-;

  4. #4
    Join Date
    Apr 2008
    Location
    San Diego, CA
    Posts
    352
    Thanks
    57
    Thanked 6 Times in 6 Posts

    Default

    homepage - > loader swf -> real swf

    take out loader, real swf works fine. Have loader load the real swf onLoad, real swf breaks.

    ...but only in the /fleet/ directory.

Bookmarks

Posting Permissions

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