Показать сообщение отдельно
Старый 16.03.2009, 00:16
avrile вне форума Посмотреть профиль Отправить личное сообщение для avrile Найти все сообщения от avrile
  № 9  
Ответить с цитированием
avrile

Регистрация: Feb 2009
Сообщений: 7
я не уверена что это весь..

Код AS1/AS2:
dd = new Sound();
mm = new Array();
// XMl code for loading URLs.
function loadXML(loaded) {
	if (loaded) {
		for (i2=0; i2<this.firstChild.childNodes.length; i2++) {
			mm[i2] = this.firstChild.childNodes[i2].firstChild.nodeValue;
			dd.loadSound(mm[0], true);
		}
	} else {
		trace("file not loaded!");
	}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("list.xml");
 
var i:Number = 0;
 
function playprev() {
	//	if (i>0) { 
	//i -= 1;
	// this will make it play in repeat mode , 
	if (i == 0) {
		i = mm.length-1;
	} else {
		i -= 1;
	}
	dd.loadSound(mm[i], true);
	if (noprenext) {
		noplay();
	}
	list_mmc.list_p.list.selectedIndex = i;
}
function playnext() {
	i += 1;
	// this will make it play in repeat mode , 
	if (i>mm.length-1) {
		i = 0;
	}
	list_mmc.list_p.list.selectedIndex = i;
	dd.loadSound(mm[i], true);
	if (noprenext) {
		noplay();
	}
}
fscommand("allowscale", "false");
xx = bar._width;
orginal_width = bar._width;
_root.soundbtndis._visible = false;
_root.soundbtndis.disabled = true;
dd.setVolume(200);
this.onEnterFrame = function() {
	dd.onSoundComplete = function() {
		startoff();
		playnext();
	};
	t1 = int(dd.duration/1000/60);
	t1 = t1+" : "+int((dd.duration/1000-(t1*60)));
	ddf = int((dd.duration-dd.position)/1000/60);
	elapsed_sec = int((((dd.duration-dd.position)/1000/60)-ddf)*60);
	if (elapsed_sec<10) {
		elapsed_sec = "0"+elapsed_sec;
	}
	if (ddf<10) {
		ddf = "0"+ddf;
	}
	if (_root.stpd) {
		elapsed = _root.t1;
	} else {
		elapsed = ddf+" : "+elapsed_sec;
	}
	//mo=dd.position/1000
	//elapsed =  
	vol = dd.getVolume()+" %";
	dur = dd.duration;
	pos = dd.position;
	per = (pos/dur)*100;
	m = (pos/dur)*100;
	bar._width = (m*xx)/100;
	drag._x = _root.bar._width+_root.bar._x;
	//drag._y = 136;
	if (stpd) {
		xx = 0;
	} else {
		xx = orginal_width;
	}
	// function keys
	if (Key.isDown(67)) {
		pauseit();
	}
	if (Key.isDown(88)) {
		playit();
	}
	if (Key.isDown(86)) {
		stopit();
	}
	//**************************************                                                                                                                                        
	_root.shorba.art = "Artist :"+dd.id3.artist;
	_root.shorba.song = "Title :"+dd.id3.songname;
	_root.shorba.setMask(_root.loo7);
	// Handling undefined or null Tag values 
	// Note this works with URL form like that d:\songs\song.mp3
	if (_root.shorba.art == "Artist :"+undefined || _root.shorba.art == "Artist :"+'') {
		_root.shorba.art = String(mm[i]);
		dotpos = _root.shorba.art.lastIndexOf('.');
		slashpos = _root.shorba.art.lastIndexOf('\\');
		_root.shorba.art = "Artist :"+_root.shorba.art.substring(slashpos+1, dotpos);
	}
	if (_root.shorba.song == "Title :"+undefined || _root.shorba.song == "Title :"+'') {
		_root.shorba.song = String(mm[i]);
		dotpos = _root.shorba.song.lastIndexOf('.');
		slashpos = _root.shorba.song.lastIndexOf('\\');
		_root.shorba.song = "Title :"+_root.shorba.song.substring(slashpos+1, dotpos);
	}
};
_root.information.setMask(_root.infomask);
Добавлено через 53 секунды
и еще

Код AS1/AS2:
// play button function
function startoff() {
	ply = true;
	stpd = false;
	_root.dd.stop();
	stopAllSounds();
	_root.dd.start();
	pus = false;
	if (!noprenext) {
		_root.information.info = "";
		_root.information.play();
		_root.information.info = "Playing";
	}
}
function playit() {
	ply = true;
	noprenext = false;
	stpd = false;
	_root.information.info = "";
	_root.information.play();
	_root.information.info = "Playing";
	if (listloaded) {
		if (pus && _root.pindex == i) {
			_root.dd.start(position);
			pus = false;
		} else {
			_root.dd.stop();
			stopAllSounds();
			_root.dd.start();
			item = _root.pindex;
			i = item;
			dd.loadSound(mm[item], true);
			pus = false;
		}
	} else {
		if (pus) {
			_root.dd.start(position);
			_root.information.info = "Playing";
			pus = false;
		} else {
			_root.dd.stop();
			stopAllSounds();
			_root.dd.start();
		}
	}
}
//pause button function
function pauseit() {
	if (!_root.stpd) {
		position = _root.dd.position/1000;
		if (!pus) {
			_root.dd.stop();
			pus = true;
			_root.information.info = "";
			_root.information.play();
			_root.information.info = "Paused";
		} else {
			_root.dd.start(position);
			pus = false;
			_root.information.info = "Playing";
		}
	}
}
//stop button function 
function stopit() {
	if (!stpd) {
		_root.dd.stop();
		stpd = true;
		noprenext = true;
		pus = false;
		_root.information.info = "";
		_root.information.info = "Stopped";
		_root.information.play();
	}
}
function noplay() {
	if (!stpd) {
		_root.dd.stop();
		stpd = true;
		//noprenext = true;
		pus = false;
	}
}
Добавлено через 7 минут
serenkiy, боюсь пошлете вы меня сейчас

если есть решение попроще, то согласна на все возможные варианты с одной стороны уже всех собак готова спустить на этого профа, но с другой, так хотелось бы покопаться и проникнуться этим чудом-программированием во флеше..


Последний раз редактировалось iNils; 16.03.2009 в 00:58.