Показать сообщение отдельно
Старый 06.04.2008, 18:42
player вне форума Посмотреть профиль Отправить личное сообщение для player Посетить домашнюю страницу player Найти все сообщения от player
  № 3  
Ответить с цитированием
player
 
Аватар для player

Регистрация: Dec 2007
Сообщений: 27
переписал верхнюю чушь на это
Код:
var ind:Number = 0;
var ind0:Object = NULL;
var ind1:Object = NULL;
var pri:Number = 0;
// длинна кнопки
var BTNW:Number = 166;
// высота кнопки
var BTNH:Number = 100;
// интервал

// оздает загрузчик клипа
var loader:MovieClipLoader = new MovieClipLoader;
// добавляет в загрузчик обработчик событий
loader.addListener(this);

// гружу первую картинку сразу
rand_file = Math.random();
rand_file = rand_file * 11;
rand_file = Math.floor(rand_file);
var pict_mc = createEmptyMovieClip("pict_mc",-1);
loader.loadClip(rand_file+".jpg",this.pict_mc);


function automat1() {
	rand_file = Math.random();
	rand_file = rand_file * 11;
	rand_file = Math.floor(rand_file);
	pict_mc = createEmptyMovieClip("pict_mc"+ind,ind);
		trace(pict_mc);
	loader.loadClip(rand_file+".jpg","pict_mc"+ind);
	ind0 = pict_mc;
	trace("automat " + ind0);
	ind++;
	_root["pict_mc"+ind]._x=0;
}
function onLoadInit(_pic:MovieClip) {
	_pic._width = BTNW;
	_pic._height = BTNH;
	_pic._alpha=0;
	_pic.onEnterFrame = function() {
		if (_pic._alpha<100) {
			_pic._alpha += 10;
		} else {
			delete _pic.onEnterFrame;
		}
	};

	trace("удаляю " + _root["pict_mc"+(ind-3)]._width);
	_root["pict_mc"+(ind-3)].removeMovieClip();
	
	
}
my_interval = setInterval(automat1, (Math.floor(Math.random()*5+1)*1000));
тоже чушь но получше. До клипа достучался но память все равно ест.