The widget that's actually uploaded to the chumby website is just a loader - here's the code:
var randomNum:String = String(Math.ceil(Math.random()* 1000));
var swf_name:String = "http://www.worth1000.com/widgets/chumby.swf?random=" + randomNum;
var slide_show_mc:MovieClip = this.createEmptyMovieClip("slide_show_mc",1);
slide_show_mc.loadMovie(swf_name);
The loader calls another swf, which is actually the widget. I know it's loading to some degree, since the textbar (not the text itself, just the bar beneath the text) is showing up. But that's about it that shows. Below is the widget code. Any help would be appreciated:
var rssObject;
var numPics;
var currentPic;
var intervalTime;
var loadListener:Object = new Object();
//When image begins loading this function is invoked to scale the image,
//center it, and apply a transition to it. After waiting 4 seconds (4000 ms),
//calls the function to load the next image.
loadListener.onLoadInit = function(target_mc:MovieClip){
//scale movie clip to fit the stage once it had loaded
var scaleRatioHeight = (240/ target_mc._height);
var scaleRatioWidth = (320/ target_mc._width);
if(scaleRatioHeight < scaleRatioWidth) {
target_mc._height = 240;
target_mc._xscale = target_mc._yscale;
}
else {
target_mc._width = 320;
target_mc._yscale = target_mc._xscale;
}
//center the movie clip
target_mc._x = (320 - target_mc._width)/2;
intervalTime = setInterval(loadNextImage,4000);
};
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
//Parses RSS Object and calls function to load the first image
this.receiveRSSObject = function(rssObject1)
{
rssObject = rssObject1;
numPics = rssObject.channels[0].items.length;
trace("Channel Title: " + rssObject.channels[0].title);
currentPic = -1;
loadNextImage();
}
//Displays picture and title bar
function loadNextImage()
{
//ensure that for each setInterval, loadNextImage gets called only once
clearInterval(intervalTime);
currentPic++;
currentPic %= numPics; //shows first image again after last infinitely
trace("Item Title: " + rssObject.channels[0].items[currentPic].title);
trace(rssObject.channels[0].items[currentPic].description);
this.createEmptyMovieClip("pic1_mc", 1);
mcLoader.loadClip (rssObject.channels[0].items[currentPic].description, pic1_mc);
//create the text bar
this.attachMovie("txtbar_mc", "textBar_mc", 1000);
textBar_mc._height = 25;
textBar_mc._width = 320;
textBar_mc._y = 240 - textBar_mc._height;
textBar_mc._x = 0;
var formatText:TextFormat = new TextFormat();
formatText.align = "center";
formatText.color = 0x000000;
formatText.url= rssObject.channels[0].items[currentPic].link;
//set text of the title bar as hyperlink
textBar_mc.title_txt.html = true;
textBar_mc.title_txt.htmlText = rssObject.channels[0].items[currentPic].title;
textBar_mc.title_txt.setTextFormat(formatText);
}
rssObj = new RSSDataFactory()
rssObj.parseFeed("http://www.worth1000.com/potdchumbie.asp",
this, "receiveRSSObject");