Use conditional operator to set a default value for an undefined variable
package{ import flash.display.Sprite; public class Main extends Sprite{ public function Main(){ var weather:String; weather = weather ? weather : "partly cloudy"; trace(weather); } } }