Packagecom.yahoo.webapis.weather
Classpublic class WeatherService
InheritanceWeatherService Inheritance flash.events.EventDispatcher

Yahoo! Weather API Service Class. This class is the main entrypoint into the Yahoo! Weather AS3 Library.



Public Properties
 PropertyDefined by
  api_URL : String
The URL for the weather API.
WeatherService
  weather : Weather
The container for the current weather conditions.
WeatherService
Public Methods
 MethodDefined by
  
WeatherService constructor.
WeatherService
  
getWeather(location:String, units:String):void
This method makes a request for the current and forecast weather conditions.
WeatherService
Events
 EventSummaryDefined by
    WeatherService
    WeatherService
    WeatherService
Property detail
api_URLproperty
api_URL:String  [read-write]

The URL for the weather API. Can be changed if necessary.

Implementation
    public function get api_URL():String
    public function set api_URL(value:String):void
weatherproperty 
public var weather:Weather

The container for the current weather conditions.

Constructor detail
WeatherService()constructor
public function WeatherService()

WeatherService constructor.

Method detail
getWeather()method
public function getWeather(location:String, units:String):void

This method makes a request for the current and forecast weather conditions. When the weather conditions are retrieved, the current instance of WeatherService dispatches a WeatherResultEvent.WEATHER_LOADED event. If an error occurs, the WeatherService dispatches a WeatherResultEvent.XML_LOADING or a WeatherResultEvent.INVALID_LOCATIOn event.

Parameters
location:String — Either a U.S. zip code, or a special international location code, which can be obtained at http://weather.yahoo.com
 
units:String — A string, either a Units.METRIC_UNITS, or a Units.ENGLISH_UNITS, specifying the units to return the data in.
Event detail
invalidLocationErrorevent 
Event object type: com.yahoo.webapis.weather.events.WeatherErrorEvent

weatherLoadedevent  
Event object type: com.yahoo.webapis.weather.events.WeatherResultEvent

xmlLoadingErrorevent  
Event object type: com.yahoo.webapis.weather.events.WeatherErrorEvent