开发者

Embedding images in flash cs4 using as3

开发者 https://www.devze.com 2023-03-01 08:00 出处:网络
I want to embed images in flash cs4 according to some description. the description value is coming from webservice.

I want to embed images in flash cs4 according to some description. the description value is coming from webservice.

for example-> if the description is "Fair" then i have to display fair.png image or if it is "HeavyRain" then i hav开发者_StackOverflow中文版e to display HeavyRain.png image and so on..

how do i proceed.
can anybody help me out

Thanks 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 is the 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);
}

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号