I'm trying to load HTML/CSS from an external domain into a SWF using Actionscript 3. The data loads properly when I "test movie" out of Flash. However, when I upload the SWF to the website, it will no longer import the data. Here is an example of my code...
import flash.events.MouseEvent;
var req:URLRequest = new URLRequest("http://website.com/feeds/feed-upcoming-events.php?limit=12&format=html");
var loader:URLLoader = new URLLoader();
var cssReq:URLRequest = new URLRequest("http://website.com/feeds/feed-upcoming-events.css");
var cssLoader:URLLoader = new URLLoader();
function fileLoaded(event:Event):void
{
this.feed_ani_mc.feed_mc.feed_txt.htmlText = loader.data;
}
function cssLoaded(event:Event):void
{
var sheet:StyleSheet = new StyleSheet();
sheet.parseCSS(cssLoader.data);
this.feed_ani_mc.feed_mc.feed_txt.styleSheet = sheet;
}
loader.addEventListener(Event.COMPLETE, fileLoaded);
loader.load(req);
cssLoader.addEventListener(Event.COMPLETE, cssLoaded);
cssLoader.load(cssReq);