2011-04-29 57 views
0

我想根據一些說明將圖像嵌入到閃存cs4中。 描述值來自webservice。使用as3將圖像嵌入到閃存cs4中

用於示例 - > 如果描述是「公平」,那麼我有顯示fair.png圖像或 如果是「HeavyRain」,那麼我有顯示HeavyRain.png圖像等..

how do i proceed. 
can anybody help me out 

Thanks in advance. 

Sushma

回答

0

import mx.core.BitmapAsset;
[Embed(「assets/Fair.png」)]
const Fair:Class; [Embed(「assets/Cldy.png」)]
const Cldy:Class;
[Embed(「assets/Sunny.png」)]
const Sunny:Class;
[Embed(「assets/Fog.png」)]
const Fog:Class;

var desc:String = new String();

如果(降序== 「一般」){
VAR FairImg:了BitmapAsset =新博覽會();
TemperatureImageId.addChild(FairImg); // TemperatureImageId是圖形符號的標識
} else if(desc ==「Cloudy」){
var Cloudy:BitmapAsset = new Cldy();
TemperatureImageId.addChild(Cloudy);
} else if(desc ==「Sunny」){
var Sunny:BitmapAsset = new sunny();
TemperatureImageId.addChild(Sunny);其他if(desc ==「Fog」){
} else if(desc ==「Fog」){
var Fog:BitmapAsset = new Fog();
TemperatureImageId.addChild(Fog);
}