Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/11/2007, 05:31
Avatar de CREW
CREW
 
Fecha de Ingreso: diciembre-2004
Ubicación: Mi Casa
Mensajes: 793
Antigüedad: 19 años, 4 meses
Puntos: 0
Problemas con Reproductor de Audio

Buenas estimados...

Les cuento que descargue un ejemplo de Flash Kit, de un reproductor que trabaja con XML, resulta que lo modifique (en su aspecto grafico) un poco para adaptarlo a mi Web, bueno resulta que el reprodcutor funciona bien al visualizarlo...

Mi problema esta en cuando lo carga como SWF externo sobre mi Pelicula base, ya que a pesar de cargar el audio, no me funcionana los controles (botones y volumen), ocurre lo mismo si lo inserto en mi pelicula base directamente pero dentro de un MC tampoco funciona...

No se a que se debe, ya que no soy un experto en AS, asi que por eso recurri a uds.

aqui les dejo el codigo:

Código:
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;
omment
now.mp3";
//*****************************************************************************
function playprev() {
	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;
	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;
	}
	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;
	if (stpd) {
		xx = 0;
	} else {
		xx = orginal_width;
	}
	if (Key.isDown(67)) {
		pauseit();
	}
	if (Key.isDown(88)) {
		playit();
	}
	if (Key.isDown(86)) {
		stopit();
	}
	//**************************************                                                                                                                                        
	_root.shorba.art = "Artista :"+dd.id3.artist;
	_root.shorba.song = "Titulo :"+dd.id3.songname;
	_root.shorba.setMask(_root.loo7);
	if (_root.shorba.art == "Artista :"+undefined || _root.shorba.art == "Artista :"+'') {
		_root.shorba.art = String(mm[i]);
		dotpos = _root.shorba.art.lastIndexOf('.');
		slashpos = _root.shorba.art.lastIndexOf('\\');
		_root.shorba.art = "Artista :"+_root.shorba.art.substring(slashpos+1, dotpos);
	}
	if (_root.shorba.song == "Titulo :"+undefined || _root.shorba.song == "Titulo :"+'') {
		_root.shorba.song = String(mm[i]);
		dotpos = _root.shorba.song.lastIndexOf('.');
		slashpos = _root.shorba.song.lastIndexOf('\\');
		_root.shorba.song = "Titulo :"+_root.shorba.song.substring(slashpos+1, dotpos);
	}
};
_root.information.setMask(_root.infomask);
codigo de los controles:

Código:
// 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;
	}
}
Espero me puedan hechar una ayuda!!!

De antemano GRACIAS!!!!!
__________________
_________________________________
Mario Contreras || Diseñador Gráfico + Web:Mi Blog