效果如下截图:

Flex 天气预报

 

 

 

 

 

 

 

 

 

 

创建一个Flex项目weather

 在weather.mxml中添加一个httpWebservice如下代码:

 <mx:HTTPService  >
  
 </mx:HTTPService>

定义一个onResult函数如下:

[Bindable]

private var xml:XMl=new XML();

   private function onResult(e:ResultEvent):void{
   xml=XML(e.result); 
   }

 在weather.mxml中添加一个creationComplete="init()"函数

private function init():void{

hs.send();

}

然后再应用程序中添加一个TitleWindow控件,然后再添加一个TileList控件,如下:

 <mx:TitleWindow x="173" y="238" width="432" height="235" title="北京" layout="absolute">
  <mx:TileList x="10" y="10" width="392" height="175" dataProvider="{xml.weather.forecast_conditions}"
    columnCount="4" itemRenderer="part1"></mx:TileList>
 </mx:TitleWindow>

为titlelist创建一个项目渲染器part1如下:

Flex 天气预报

相关文章:

  • 2021-10-13
  • 2021-04-03
  • 2021-04-09
  • 2022-01-08
  • 2021-10-09
  • 2021-08-26
猜你喜欢
  • 2021-12-19
  • 2021-06-16
  • 2021-11-16
  • 2021-09-24
相关资源
相似解决方案