Results 1 to 4 of 4

Thread: New to AS3 and xml...please help

  1. #1

    New to AS3 and xml...please help

    Alright, here goes:

    I'm creating a personal website and I've been working on a section where you can get the latest news headlines. Everything seems to work perfectly when I'm in CS3 but when I put the .swf file onto my site it doesn't show anything.

    the site is here:

    http://filebox.vt.edu/users/patel/index3.html

    and this is the code:

    var loader:URLLoader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, onLoaded);

    lb.addEventListener(Event.CHANGE, itemChange);

    function itemChange(e:Event):void
    {
    ta2.text = lb.selectedItem.label;
    ta.text = lb.selectedItem.data;
    //ta3.htmlText = "For full story click here " + lb.selectedItem.link;
    ta3.htmlText = "<a href=\"" + lb.selectedItem.link + "\">" + "For full story CLICK HERE" + "</a>";
    }

    var xml:XML;

    function onLoaded(e:Event):void
    {
    xml = new XML(e.target.data);
    var il: XMLList = xml.channel.item;
    for(var i:uint=0; i<il.length(); i++)
    {
    lb.addItem({data:il.description.text()[i], link:il.link.text()[i],
    label:il.title.text()[i]});
    }

    }

    loader.load(new URLRequest("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml"));

  2. #2
    1,596
    posts
    Holosuite User
    Try installing debug player, it would save you from situation like this
    This is the error message I get when enter your site:
    Error #2044: Unhandled securityError:. text=Error #2048: Security sandbox violation: http://filebox.vt.edu/users/patel/xml.swf cannot load data from http://newsrss.bbc.co.uk/rss/newsonl...t_page/rss.xml.
    at xml_fla::MainTimeline/frame1()
    And here's their crossdomain.xml:
    HTML Code:
    <?xml version="1.0" ?> 
    - <cross-domain-policy>
      <allow-access-from domain="downloads.bbc.co.uk" /> 
      <allow-access-from domain="www.bbcamerica.com" /> 
      <allow-access-from domain="*.bbcamerica.com" /> 
      <allow-access-from domain="www.bbc.co.uk" /> 
      <allow-access-from domain="news.bbc.co.uk" /> 
      <allow-access-from domain="newsimg.bbc.co.uk" /> 
      <allow-access-from domain="nolpreview11.newsonline.tc.nca.bbc.co.uk" /> 
      <allow-access-from domain="newsrss.bbc.co.uk" /> 
      <allow-access-from domain="newsapi.bbc.co.uk" /> 
      <allow-access-from domain="extdev.bbc.co.uk" /> 
      <allow-access-from domain="stats.bbc.co.uk" /> 
      <allow-access-from domain="*.bbc.co.uk" /> 
      <allow-access-from domain="*.bbc.com" /> 
    - <!-- allow access for BBC jam servers
      --> 
      <allow-access-from domain="jam.bbc.co.uk" /> 
      <allow-access-from domain="dc01.dc.bbc.co.uk" /> 
      </cross-domain-policy>
    And... your site isn't on the list, so you can't get the data from there...

  3. #3
    I see...thanks a lot for the help, now I just have to find an rss where I can get the information

  4. #4
    1,596
    posts
    Holosuite User
    Hm... actualy, you may have some PHP/ASP script on your server that'll get the feed whence flash requests it. So that flash won't have to load the feed by itself.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012