Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

kika

Player MP3 só funciona Local

Recommended Posts

Pessoal,

 

Fiz um player MP3 em Flash+XML e quando testo local funciona perfeitamente, as músicas tocam, o nome da música aparece, mas qd transfiro para o ftp e testo no site, não funciona, não toca e o nome da música aparece undefined

O que pode estar acontecendo?...acredito que só pode ser erro no caminho mas não sei como resolver pois como está aqui, criei as pastas exatamente iguais no ftp.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Quando você faz o caminho local..

 

Você coloca assim mp3/musica

 

Quando você faz online tem que ser assim /mp3/musica

 

Pois você tem todo o endereço que vem antes do seu site ;)

 

Veja se não é isso

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

Vou postar o código aqui da forma que funciona local

 

Meu XML: musicas.xml

 

<?xml version="1.0" encoding="UTF-8"?>
	<radio>
	<station name="csm" text="csm">

<!-- MÚSICAS -->
		<song>
		<composer>ColdPlay</composer>
		<title>Viva la Vida</title>
		<file>musicas/Viva la Vida - coldplay.mp3</file>
		</song>	


	</station>
	</radio>

 

Parte do action do flash index.swf:

 

function Song(title, composer, file)
{
	this.title = title;
	this.composer = composer;
	this.file = file;
} // End of the function
function Station(name, arrSongs)
{
	this.name = name;
	this.arrSongs = arrSongs;
} // End of the function
function Radio(arrStations)
{
	this.arrStations = arrStations;
} // End of the function
function traceRadio(objRadio)
{
	for (j = 0; j < objRadio.arrStations.length; j++)
	{
		traceStation(objRadio.arrStations[j]);
	} // end of for
} // End of the function
function traceStation(objStation)
{
	trace ("-----------------");
	trace ("Station Name: " + objStation.name);
	for (i = 0; i < objStation.arrSongs.length; i++)
	{
		traceSong(objStation.arrSongs[i]);
	} // end of for
} // End of the function
function traceSong(objSong)
{
	trace ("title: " + objSong.title);
	trace ("composer: " + objSong.composer);
	trace ("file: " + objSong.file);
	trace ("**");
} // End of the function
function loadStations()
{
	mcStations.removeAll();
	for (var _loc1 = 0; _loc1 < objRadio.arrStations.length; ++_loc1)
	{
		mcStations.addItem(objRadio.arrStations[_loc1].name, _loc1);
	} // end of for
} // End of the function
function radioPlay()
{
	trace (">>start");
	traceSong(objRadio.arrStations[intStation].arrSongs[intSong]);
	txtTitle = objRadio.arrStations[intStation].arrSongs[intSong].title;
	txtStation = objRadio.arrStations[intStation].name;
	txtComposer = objRadio.arrStations[intStation].arrSongs[intSong].composer;
	if (!s)
	{
		s = new Sound();
		s.onSoundComplete = function ()
		{
			radioNext();
		};
	} // end if
	var _loc1 = objRadio.arrStations[intStation].arrSongs[intSong].file;
	s.loadSound(_loc1, true);
	s.start();
	instStatus.posReset();
	instStatus.gotoAndPlay(1);
	mLoaded.paramTarget = "s";
	mLoaded._visible = true;
	mLoaded.gotoAndPlay(1);
} // End of the function
function radioStop()
{
	trace (">>stop");
	s.stop();
} // End of the function
function radioNext()
{
	++intSong;
	if (intSong >= objRadio.arrStations[intStation].arrSongs.length)
	{
		intSong = 0;
	} // end if
	radioPlay();
} // End of the function
function radioPrevious()
{
	--intSong;
	if (intSong < 0)
	{
		intSong = objRadio.arrStations[intStation].arrSongs.length - 1;
	} // end if
	radioPlay();
} // End of the function
function stationNext()
{
	++intStation;
	if (intStation >= objRadio.arrStations.length)
	{
		intStation = 0;
	} // end if
	intSong = 0;
	radioPlay();
} // End of the function
function stationPrevious()
{
	--intStation;
	if (intStation < 0)
	{
		intStation = objRadio.arrStations.length - 1;
	} // end if
	intSong = 0;
	radioPlay();
} // End of the function
cxml.url = "musicas.xml";
intStation = 0;
intSong = random(2);
newSongArray = new Array();
newStationArray = new Array();
objRadio = new Radio();
stop ();

 

O caminho está assim:

 

dentro da pasta site, tenho a pasta flas que contem os arquivos musicas.xml e index.swf e dentro da pasta flas criei a pasta musicas e coloquei a música mp3 lá dentro

Compartilhar este post


Link para o post
Compartilhar em outros sites

berseck...tentei fazer o que você falou, mas continua não funcionando

 

Eu estava tendo o mesmo problema na área de vídeos, aí fiz dessa forma abaixo e aí começou a aparecer o vídeo no site.

 

_root.sessao = "videos";
loadMovie("../flas/" + "video2.swf", "localvideo");
stop ();

Compartilhar este post


Link para o post
Compartilhar em outros sites

berseck, consegui...obrigada pela sua ajuda, valeu muito, obrigadaaaa

 

Fiz assim:

 

No código XML fiz assim:

<file>../flas/musicas/Viva la Vida - coldplay.mp3</file>

 

e no Flash:

cxml.url = "../flas/" + "musicas.xml";

 

 

Agora deixa só te perguntar mais uma coisa...minha música tá tocando aí acesso a área de vídeos e clico para ver o vídeo, tem como a música do site parar automaticamente sem que o cliente tenha que dar stop?

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tem basta que no código de troca de página você coloque o código de parada de musica tbm ;)

 

No caso você ta usando s como sound só dar um

 

s.stop();

 

quando o cliente clicar em um botão ;)

 

Ou stopAllSounds();

 

Abraços

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.