Weather Report by entering zip code

<?xml version=”1.0″ encoding=”utf-8″?>
<mx:Application xmlns:mx=”; layout=”vertical” backgroundAlpha=”0″
<mx:HTTPService id=”weatherService” url=”; resultFormat=”e4x”
private namespace yweather = “;;
use namespace yweather;
private var myResult:XML;
public function requestWeather():void
var params:Object = new Object();
params.p = zip.text;
public function resultHandler(event:ResultEvent):void
myResult = XML( event.result );

<mx:Form width=”400″>
<mx:FormItem label=”Zip Code”>
<mx:TextInput id=”zip” />
<mx:Button label=”Get Weather” click=”requestWeather();”/>
<mx:FormItem label=”City”>
<mx:Text text=”{}”/>
<mx:FormItem label=”Temperature”>
<mx:Text text=”{}”/>
<mx:FormItem label=”Condition”>
<mx:Text text=”{}” width=”100%”/>
<mx:TextArea id=”resultFld” text=”{myResult}” width=”400″ height=”152″/>

~ by mjcprasad2000 on January 27, 2009.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: