Revision 353865656331 () - Diff

Link to this snippet: https://friendpaste.com/3vsfxPpryEG3MexE5Ck2jO
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class DetailModel extends InjectorTarget
{
/*-.........................................weather..........................................*/
private var _weather:CurrentConditions;
public function get weather():CurrentConditions
{
return _weather;
}
[Bindable]
public function set weather(w:CurrentConditions):void {
_weather = w;
humidity = _weather.atmosphere.humidity;
description = _weather.description;
formatUnits();
}
/*-.........................................formatUnits..........................................*/
private function formatUnits():void
{
if (weather && units) {
pressure = weather.atmosphere.pressure + " " + units.pressure + " and " + weather.atmosphere.rising;
wind = (weather.wind.speed > 0)?( weather.wind.speed + " " + units.speed):'Calm';
visibility = Number(weather.atmosphere.visibility)/100 + " " + units.distance;
}
}
}