web services - Embedding images in flash cs4 using as3 -
i want embed images in flash cs4 according description. description value coming webservice.
for example-> if description "fair" have display fair.png image or if "heavyrain" have display heavyrain.png image , on..
how proceed. can me out in advance.
sushma
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();
if(desc == "fair"){
var fairimg:bitmapasset = new fair();
temperatureimageid.addchild(fairimg); //temperatureimageid id of graphic symbol
} else if(desc == "cloudy"){
var cloudy:bitmapasset = new cldy();
temperatureimageid.addchild(cloudy);
}else if(desc == "sunny"){
var sunny:bitmapasset = new sunny();
temperatureimageid.addchild(sunny);
}else if(desc == "fog"){
var fog:bitmapasset = new fog();
temperatureimageid.addchild(fog);
}
Comments
Post a Comment