Saving a value in a var forever?
Hi guys...
Is there anyway to save a var value forever?
Like... let´s say I have this:
private var b:int;
private var xb:int;
public function UPD()
{
start()
}
private function start():void
{
//add a button to do something
//add a button to do whatever
}
//define the listener for the buttons (MouseEvent.CLICK, something & MouseEvent.CLICK, whatever)
private function something(e:MouseEvent):void
{
if (!b){b = (1 + xb);}
//another function to do something else after adding b + xb
}
private function whatever(e:MouseEvent):void
{
xb++
}
This way xb (and b) will have 1 more each time I click on the whatever button...now let´s say I close everything...how can I have the values I had before, back, when I open it again, so xb doesn´t start from 0 again, but it keeps the clicks from previous time?
Thanks a lot!!!