Показать сообщение отдельно
Старый 15.08.2005, 03:30
nuran вне форума Посмотреть профиль Отправить личное сообщение для nuran Найти все сообщения от nuran
  № 7  
Ответить с цитированием
nuran

Регистрация: Apr 2003
Адрес: DC
Сообщений: 4,489
Я вот писал что-то для яркости и контраста ...


Код:
_global.MovieClip.prototype.addProperty ("_brightness", function ()
{
	if (typeof (this._brightness_) != "number")
	{
		this._brightness_ = 100;
	}
	return this._brightness_;
}, function (v:Number)
{
	this._brightness_ = v;
	var color:Color = new Color (this);
	var c:Number = 100;
	if (typeof (this._contrast_) == "number")
	{
		c = this._contrast_;
	}
	color.setTransform ({ra:c, rb:2.55 * v - 255, ga:c, gb:2.55 * v - 255, ba:c, bb:2.55 * v - 255, aa:100, ab:100});
});

//--------------------------------------------------------------------------------------------------------------------------------

_global.MovieClip.prototype.addProperty ("_contrast", function ()
{
	if (typeof (this._contrast_) != "number")
	{
		this._contrast_ = 100;
	}
	return this._contrast_;
}, function (v:Number)
{
	this._contrast_ = v;
	var color:Color = new Color (this);
	var b:Number = 0;
	if (typeof (this._brightness_) == "number")
	{
		b = 2.55 * this._brightness_;
	}
	color.setTransform ({ra:v, rb:b, ga:v, gb:b, ba:v, bb:b, aa:100, ab:100});
});
__________________
flash/flex/unity