Ir para conteúdo

POWERED BY:

Arquivado

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

MacRoger

loop mp3 xml

Recommended Posts

http://forum.imasters.com.br/public/style_emoticons/default/joia.gif Alguem saberia me informar se é possível dar LOOP em mp3 baixados por XML, exemplo:

Tenho um Player sound MP3, ele busca as músicas atraves de um arquivo .xml, como posso dar loop na 1ª, 2ª, 3ª... música, se for possível. Alguem pode me dar uma Luz nesta ai?

 

VALEU MOÇADA.

 

MACROGER.

Compartilhar este post


Link para o post
Compartilhar em outros sites

mostre como você está pegando os dados do xml, e eu vejo se posso ajudar

Compartilhar este post


Link para o post
Compartilhar em outros sites

http://forum.imasters.com.br/public/style_emoticons/default/clap.gif

mostre como você está pegando os dados do xml, e eu vejo se posso ajudar

<{POST_SNAPBACK}>

Através de um componete "FSound v 1.0.0" que peguei no site http://www.flashmxpro.com, vá até o link components e ele está lá. Ele é muito bom, mas tem alguns BUGS, tive que editar para funcionar legal, o BUG é quando você clica no botão existente no player para abrir os controles de PLAY, PAUSE, STOP, AVANÇAR E VOLTAR, O botão não esta funcionando, não abre os controles.

As actionscrit estão todas lá, também o código XML.

Valeu a atenção, vê se dá para resolver este probleminha e como vamos dar loop nas músicas baixada via xml?

 

Obrigado.

 

Roger.

Compartilhar este post


Link para o post
Compartilhar em outros sites

eu não falo mais nada sobre o botão "REPORTAR"não adiantaquanto ao problema assim não posso resolver....sorry

Compartilhar este post


Link para o post
Compartilhar em outros sites

Me desculpe mas não sei o que você está falando sobre o Btn REPORTAR, porque está tão irado? Explica ai!Acho que o nome dado a MODERADORES fossem ao pé da Letra, ou seja moderado, Não?Mas valeu a atenção, e me desculpe novamente, OK!Abraços,MacRoger.

Compartilhar este post


Link para o post
Compartilhar em outros sites

não estou irado, mas cansei de avisar a mesma coisa para todo mundo sobre o botão reportar, por isso pendurei um tópico no forum sobre isso, mas ninguem leunão é ira não

Compartilhar este post


Link para o post
Compartilhar em outros sites

oul velho, ngm esta aqui a disposicao para te ajudar a hora q você quer ( se controle ), como você tem muitos outros q possuem dúvidas velho, relaxa q você não é de ouro e nem é melhor q ngm para ser atendido primeiro, segura a onda ae ...bom em relação ao seu post o interessante seria você largar essa historia de componente e criar um proprio player, extraindo dados de um xml, seu xml você poderia colocar a localizacao do arquivo, e o nome do loop. a action para dar um loop no flash é simplesvar Seusom:Sound = new Sound();Seusom.loadSound("musica.mp3", true);Seusom.start(0,1);Seusom.onSoundComplete = function():Void{Seusom.start(0,999);}criei uma variavel no flash c/ valor = 0 e altere o seu valor com os botoes next e prev

Compartilhar este post


Link para o post
Compartilhar em outros sites

http://forum.imasters.com.br/public/style_emoticons/default/blush.gif Ai vai actionscript, ela é única, dá uma analisada ai e vê se tem jeito.

Antecipadamente agradeço a atenção de todos.

Roger.

[/code]

Playlist Format (Winamp 3 Playlist compatible)

// <?xml version="1.0" encoding='UTF-8' standalone="yes"?>

// <FSound-XML>

// <playlist>

// <entry Playstring="../MP3/Eple.mp3">

// <Name>Roeyscopp - Eple</Name>

// <Length>120000</Length>

// </entry>

// <entry Playstring="../MP3/So Easy.mp3">

// <Name>Roeyscopp - So Easy</Name>

// <Length>120000</Length>

// </entry>

// </playlist>

// </FSound-XML>

//

// Known Bugs / Issues / Things to fix

// - No Error messages displayed in scroll Display

// - Pause on streamed sound doesn't work

// - Loadingbar width is not eval with Title width

// - Playtime display

// - FStyleFormat not supported in this version

/////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////

#initclip 1

/////////////////////////////////////////////////////////////////

// Constructor

FSoundClass = function () {

this.init();

};

var c = FSoundClass.prototype = new FUIComponentClass();

Object.registerClass("FSoundComponent", FSoundClass);

/////////////////////////////////////////////////////////////////

c.init = function() {

super.init();

// Init Vars

this.open = false;

this.overBtn = false;

this.paused = false;

this.status = "stop";

this.activeTrack = 0;

// Init Displays

this.mc.title.autoSize = true;

this.mc.title.text = this.name + " |";

this.display.autoSize = true;

this.display._x = this.mc._x + this.mc._width;

// Init Loadingbar

this.loadingBar._x = this.equalizer._x;

// Init Player

this.scrollID = setInterval(this, "scrollDisplay", 100);

this.loadPlaylist(this.URL);

trace("[ FSound ]: Init");

};

/////////////////////////////////////////////////////////////////

// Public Methods

/////////////////////////////////////////////////////////////////

c.getEnabled = function() {

return (this.enabled);

};

c.getIDTags = function() {

return this.myPlaylist[this.activeTrack].label;

};

c.setEnabled = function(enable) {

if (enable || enable == undefined) {

this.enabled = true;

super.setEnabled(true);

} else {

this.enabled = false;

super.setEnabled(false);

}

};

c.setStreaming = function(flag) {

this.streaming = flag;

};

c.setChars = function(num) {

this.maxChars = num;

};

c.setHandCursor = function(flag) {

this.handCursor = flag;

};

c.setAutoStart = function(flag) {

this.autostart = flag;

};

/////////////////////////////////////////////////////////////////

// Sound Player Animations

/////////////////////////////////////////////////////////////////

// Set display (used for Button Actions)

c.setDisplay = function(arg) {

this.display.text = arg;

};

// Open Menu

c.openMenu = function() {

var p = this;

var speed = 3;

var xFinal = p.mc._x + p.mc._width + (this.playerButtons._width + 5);

var xPos = p.mc._x + p.mc._width + 1;

var dx = (xFinal - p.display._x) / speed;

if (dx < 1) {

p.attachMovie("playerButtons", "playerButtons", 0, {_x:xPos, _y:4});

}

p.display._x += Math.round(dx);

};

// Close Menu

c.closeMenu = function() {

var p = this;

var speed = 3;

var xFinal = p.mc._x + p.mc._width;

removeMovieClip(p.playerButtons);

var dx = (xFinal - p.display._x) / speed;

p.display._x += Math.round(dx);

delete p;

};

// Handle Open and Close

c.menu = function() {

var p = this;

if (!this.open) {

p.open = true;

clearInterval(p.closeID);

p.openID = setInterval(p, "openMenu", 10);

} else {

p.open = false;

clearInterval(p.openID);

p.closeID = setInterval(p, "closeMenu", 10);

}

delete p;

};

// Scroll Display Text when it's too long

c.scrollDisplay = function() {

var p = this;

var arg = p.getIDTags();

if (!p.overBtn) {

if ((arg.length - 1) > p.maxChars) {

if (i >= 0) {

p.setDisplay(arg.substr(i, p.maxChars));

}

if (!end && i < arg.length) {

i += 0.5;

if (i == arg.length - (p.maxChars - 2)) {

end = true;

}

} else {

i -= 0.5;

if (i == -5) {

end = false;

}

}

} else {

p.setDisplay(arg);

}

}

delete p;

};

/////////////////////////////////////////////////////////////////

// Sound Player Functionality

/////////////////////////////////////////////////////////////////

// Load XML Data from given URL

c.loadPlaylist = function(URL) {

this.myXML = new XML();

this.myXML.ignoreWhite = true;

this.myXML.myClip = this;

this.myXML.onLoad = function(success) {

if (success) {

trace("[ FSound ]: XML loaded...");

// Parse Tracks to an Array and display those in the Listbox Component

this.myClip.parsePlaylist();

} else {

trace("[ FSound ]: Failed loading XML!");

//Debug Info to Display

}

};

this.myXML.load(URL);

};

// Parse XML structure to Playlist Array

c.parsePlaylist = function() {

var p = this;

//Hardwired XML reader to read the XML playlist.

//First get the number of songs

p.songNumber = p.myXML.firstChild.firstChild.childNodes.length;

//create playlist object

p.myPlaylist = new Array();

//new object created

p.songList = new XML();

p.songList = p.myXML.firstChild.firstChild;

p.mySong = p.songList.firstChild;

for (var i = 0; i < p.songNumber; i++) {

// Fill up Object with XML Data Winamp 3 Playlist compatible

p.source = p.mySong.attributes.Playstring;

p.name = p.mySong.firstChild.firstChild.nodeValue;

p.length = p.mySong.firstChild.nextSibling.firstChild.nodeValue;

p.label = p.name;

// Fill up array

p.myPlaylist = {label:p.label, name:p.name, length:p.length, source:p.source};

p.mySong = p.mySong.nextSibling;

}

// Autostart if enabled

if (p.enabled && p.autostart) {

p.playTrack();

}

trace("[ FSound ]: Playlist generated!");

delete p;

};

// Play Track

c.playTrack = function() {

var p = this;

// Check if paused

if (p.paused) {

s.start(p.pausedPos, 1);

p.paused = false;

p.status = "play";

} else {

s = new Sound();

s.stop();

s.onLoad = function(success) {

if (success) {

trace("[ FSound ]: Sound loaded");

s.start(0, 1);

p.status = "play";

} else {

trace("[ FSound ]: Loading sound failed!");

p.setDisplay("Loading failed");

p.status = "stop";

}

};

// On Sound complete play next track

s.onSoundComplete = function() {

if (p.activeTrack < (p.myPlaylist.length - 1)) {

p.activeTrack += 1;

} else {

p.activeTrack = 0;

}

s.loadSound(p.myPlaylist[p.activeTrack].source, p.streaming);

s.start(0, 1);

};

s.loadSound(p.myPlaylist[p.activeTrack].source, p.streaming);

s.start(0, 1);

}

delete p;

};

// Stop Track

c.stopTrack = function() {

s.stop();

this.status = "stop";

};

// Pause Track

c.pauseTrack = function() {

this.status = "pause";

this.paused = true;

this.pausedPos = s.position / 1000;

s.stop();

};

// Play next track

c.nextTrack = function() {

if (this.activeTrack < (this.myPlaylist.length - 1)) {

this.activeTrack += 1;

} else {

this.activeTrack = 0;

}

this.playTrack();

};

// Play previous track

c.prevTrack = function() {

if (this.activeTrack > 0) {

this.activeTrack -= 1;

} else {

this.activeTrack = (this.myPlaylist.length - 1);

}

this.playTrack();

};

/////////////////////////////////////////////////////////////////

delete c;

/////////////////////////////////////////////////////////////////

#endinitclip

/////////////////////////////////////////////////////////////////

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.