Hey there!
I am having an issue with regards to fetching XML from bbc news.
Check this:
import mx.utils.Delegate;
class Application {
private var canvas_mc:MovieClip;
private var news_xml:XML;
public function Application (mc:MovieClip)
{
canvas_mc = mc;
fetchURL();
}
private function fetchURL(): Void
{
news_xml = new XML();
news_xml.ignoreWhite = true;
var appScope:Application = this;
news_xml.onLoad = function (success)
{
trace(news_xml);
}
news_xml.load("http://news.bbc.co.uk/mobile/bbc_news/scotland/rss10.xml");
}
}
Why is it that the trace of (news_xml) is never shown?
I know the data has loaded correctly but trace does not fire. If you change the code to:
import mx.utils.Delegate;
class Application {
private var canvas_mc:MovieClip;
private var news_xml:XML;
public function Application (mc:MovieClip)
{
canvas_mc = mc;
fetchURL();
}
private function fetchURL(): Void
{
news_xml = new XML();
news_xml.ignoreWhite = true;
var appScope:Application = this;
news_xml.onLoad = function (success)
{
**trace("hi");**
}
news_xml.load("http://news.bbc.co.uk/mobile/bbc_news/scotland/rss10.xml");
}
}
Then “hi” is shown in the trace window… therefor… does anyone know why my news_xml remains blank?
Thanks