Flex位图图像无法从URL加载

时间:2014-01-13 14:04:47

标签: flex url bitmap bitmapimage

我正在制作一个新闻滑块,用于加载来自php脚本的内容。问题是当我将url放入缩略图的BitmapImage源时,图像永远不会加载:

var newsItemThumb:BitmapImage = new BitmapImage();
                        newsItemThumb.source = XMLReader.newsItem[i].thumb;
                        newsItemThumb.fillMode = "stretch";
                        newsItemThumb.width = 100;
                        newsItemThumb.height = 100;

                        // add the thumb to news
                        newsItem.addElement(newsItemThumb);

1 个答案:

答案 0 :(得分:0)

根据您的上述代码,可能是以下代码的值

XMLReader.newsItem[i].thumb;

为空或null。您可以尝试调试代码,看看它的当前值是什么?