(single) REDIGERET 17 June 2009 • by admin

Pauseknap

Med if else og en ‘boolean’
Læs om syntaksen her

this.soundButton.onPress = function () {
	if (this.spiller != true) {
		this.gotoAndStop ("play");
		this._parent.lydloop.play ();
		this.spiller = true;
	} else {
		this.gotoAndStop ("pause");
		this._parent.lydloop.stop ();
		this.spiller = false;
	}
};

Den skrabede
En anden måde at lave betingelser på – læs om syntaksen her

o.onRelease = function () {
	clicked = (!clicked) ? true : false;
	this._alpha = (clicked) ? 50 : 100;
};