RedLine 0 Denunciar post Postado Janeiro 31, 2006 Seguinte: Tenho um swf principal onde vai uma radio. O radio é um swf em separado, que lê os mp3 via xml. Quando executo em separado, funciona que dá até gosto. Se mando executar no swf principal, ele não acha os mp3 (vem como indefinido). Tá, Tá, Tá...é qualquer coisa de rumo errado, mas nem tenho idéia de onde seja http://forum.imasters.com.br/public/style_emoticons/default/blush.gif No swf principal, coloquei um container para ler o radio: onClipEvent(load) { _root.createEmptyMovieClip("cont_radio", 1); loadMovie("radio.swf", cont_radio); filme._x = 0; filme._y = 0; filme._xscale = 150; filme._yscale = 120;} Ele lê! As imagens aparecem...só o som que se perde sei lá onde... Sugestões grandes sábios da montanha? Compartilhar este post Link para o post Compartilhar em outros sites
carneirinho 7 Denunciar post Postado Janeiro 31, 2006 Tenta colocar a ação this.lockroot = true; no primeiro frame do swf onde vai a radio Compartilhar este post Link para o post Compartilhar em outros sites
RedLine 0 Denunciar post Postado Janeiro 31, 2006 Error opening URL "file:///D|/esqueleto/flash/fla/undefined" Me retorna isso. Eu sei que é erro de caminho. Só que todos os mp3 (são 7, por enquanto), estão juntos com os swf e flas....tudo na mesma pasta. E tenta subir caminho? Posto o output inteiro? http://forum.imasters.com.br/public/style_emoticons/default/blush.gif PS: **found song**strTitle: Cool Yule * strComposer: Louis Armstrong * strFile: arquivo7.mp3newSongArray.length: 2_root.traceSong[1]: manual access strTitle: undefined Olha só: eu não deixei, pelo que eu saiba, manual access... Compartilhar este post Link para o post Compartilhar em outros sites
carneirinho 7 Denunciar post Postado Janeiro 31, 2006 this._lockroot = true; sorry Compartilhar este post Link para o post Compartilhar em outros sites
RedLine 0 Denunciar post Postado Fevereiro 1, 2006 Nah....Já to começando a fazer aquelas cacas de colocar numero negativo, na base do desespero....não rola :( Vou subir o swf pro server depois passo o endereço de teste. Compartilhar este post Link para o post Compartilhar em outros sites
carneirinho 7 Denunciar post Postado Fevereiro 1, 2006 que ações você esta usando pra puxar o som? Compartilhar este post Link para o post Compartilhar em outros sites
RedLine 0 Denunciar post Postado Fevereiro 1, 2006 cxml.url = "radio.xml";function Song (title, composer, file) { this.title = title; this.composer = composer; this.file = file;}function Station (name, arrSongs) { this.name = name; this.arrSongs = arrSongs;}function Radio (arrStations) { this.arrStations = arrStations;}function traceRadio (objRadio) { for (j=0; j<objRadio.arrStations.length; j++) { traceStation(objRadio.arrStations[j]); }}function traceStation (objStation) { trace ("-----------------"); trace ("Station Name: "+objStation.name); for (i=0; i<objStation.arrSongs.length; i++) { traceSong(objStation.arrSongs[i]); }}function traceSong (objSong) { trace ("title: "+objSong.title); trace ("composer: "+objSong.composer); trace ("file: "+objSong.file); trace ("**");}function loadStations() { mcStations.removeAll(); for (var i = 0; i < objRadio.arrStations.length; i++) { mcStations.addItem(objRadio.arrStations[i].name,i); }}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 () { _root.radioNext(); } } var filename = objRadio.arrStations[intStation].arrSongs[intSong].file s.loadSound(filename, true); s.start(); instStatus.posReset(); instStatus.gotoAndPlay(1); mLoaded.paramTarget = "s"; mLoaded._visible = true; mLoaded.gotoAndPlay(1);}function radioStop () { trace (">>stop"); s.stop();}function radioNext () { intSong++; if (intSong>=objRadio.arrStations[intStation].arrSongs.length) { intSong = 0; } radioPlay();}function radioPrevious () { intSong--; if (intSong<0) { intSong = objRadio.arrStations[intStation].arrSongs.length-1; } radioPlay();}function stationNext () { intStation++; if (intStation>=objRadio.arrStations.length) { intStation = 0; } intSong = 0; radioPlay(); }function stationPrevious () { intStation--; if (intStation<0) { intStation = objRadio.arrStations.length-1; } intSong = 0; radioPlay();}intStation = 0;intSong = 0;_root.newSongArray = new Array();_root.newStationArray = new Array();_root.objRadio = new Radio();stop();Isso no radio. Primeiro frame. intStation = 0;intSong = 0;radioPlay();stop();Também no rádio, segundo frame. Existe um objXML, num mc vazio, que é de onde "puxa" as variáveis. myXML=new XML();radio_XML = new XML();function getText(node) { text = ""; for (var i = 0; i < node.childNodes.length; i++) { if (node.childNodes[i].nodeType == 3) { text += node.childNodes[i].nodeValue; } } return text;}myXML.trace = function(){ if( this.nodeType==1 ) // element trace( this.indent +" [Element] "+ this.nodeName); if( this.nodeType==3 && !this.isBlank()) // text trace( this.indent +" text) "+ this.nodeValue); for(name in this.attributes) trace( this.indent +" +-attr-->"+ name+": "+this.attributes[name]); for( var i=0; i<this.childNodes.length; i++){ this.childNodes[i].isBlank = this.isBlank; this.childNodes[i].trace = this.trace; this.childNodes[i].indent = " |"+this.indent; this.childNodes[i].trace(); }}myXML.isBlank= function (){ for( var i=0; i<this.nodeValue.length; i++) if( this.nodeValue.charCodeAt(i)>32 ) return false; return true;}myXML.onLoad = function ( ok ) { if( !ok ) trace ("load failure"); else{ trace( this.toString()); this.trace(); }}radio_XML.trace = function(){ for (var i = 0; i < this.childNodes.length; i++) { this.childNodes[i].trace = this.trace; this.childNodes[i].trace(); } if (this.nodeName == "song") { trace ("**found song"); for (var i = 0; i < this.childNodes.length; i++) { if (this.childNodes[i].nodeType == 1) { switch (this.childNodes[i].nodeName) { case "title" : strTitle = getText(this.childNodes[i]); break; case "composer" : strComposer = getText(this.childNodes[i]); break; case "file" : strFile = getText(this.childNodes[i]); break; default : break; } } } if (!_root.newSongArray) _root.newSongArray = new Array(); _root.newSongArray.push(new _root.Song(strTitle, strComposer, strFile)); trace ("**strTitle: " + strTitle + " * strComposer: " + strComposer + " * strFile: " + strFile); trace ("newSongArray.length: " + _root.newSongArray.length); trace ("_root.traceSong[" + (_root.newSongArray.length - 1) + "]: "); _root.traceSong(_root.newSongArray[_root.newSongArray.length - 1]); trace ("manual access strTitle: " + _root.newSongArray[_root.newSongArray.length - 1].title); trace (""); } if (this.nodeName == "station") { for(name in this.attributes) { if (name == "name") { strName = this.attributes[name]; if (!_root.newStationArray) _root.newStationArray = new Array(); _root.newStationArray.push(new _root.Station(strName, _root.newSongArray)); } } trace(""); trace("station[name]: " + strName); trace("call _root.traceStation()"); _root.traceStation(_root.newStationArray[_root.newStationArray.length - 1]); trace(""); delete(_root.newSongArray); } if (this.nodeName == "radio") { _root.objRadio =new _root.Radio(_root.newStationArray); } }function traceElements(node) { for (var i = 0; i < node.childNodes.length; i++) { if (node.childNodes[i].nodeType == 1) { trace("[el: " + node.childNodes[i].nodeName); var strVal = getText(node.childNodes[i]); trace(" val: " + strVal); } }}radio_XML.cleanse= function (){ if( this.nodeType == 3){ for( var i=0; i<this.nodeValue.length; i++) if( this.nodeValue.charCodeAt(i)>32 ) return; this.removeNode(); } else { for( var i=this.childNodes.length; i--; ){ this.childNodes[i].cleanse = this.cleanse; this.childNodes[i].cleanse(); } }}radio_XML.isBlank= function (){ for( var i=0; i<this.nodeValue.length; i++) if( this.nodeValue.charCodeAt(i)>32 ) return false; return true;}radio_XML.onLoad = function ( ok ) { if( !ok ) trace ("load failure"); else{ trace( this.toString()); this.cleanse(); this.trace(); trace("inline call of _root.traceRadio();"); _root.traceRadio(_root.objRadio); _root.nextFrame(); }} myXML.load(url); radio_XML.load(url); Beleza...ficou imenso mas funciona se eu não tentar ler no principal como externo. Quer dizer, a rádio funciona, me retorna os valores todos no output panel depois de qualquer funçao, tudo lindo. Só na hora de carregar no principal, desabilita a leitura dos sons. Desculpa o post enorme. David Compartilhar este post Link para o post Compartilhar em outros sites
carneirinho 7 Denunciar post Postado Fevereiro 1, 2006 tem como você postar o fla e o xml ai?, mais a parte de programação Compartilhar este post Link para o post Compartilhar em outros sites
RedLine 0 Denunciar post Postado Fevereiro 1, 2006 fla.radio radio.xml (tá marcado como fla.zip) Grato Compartilhar este post Link para o post Compartilhar em outros sites
carneirinho 7 Denunciar post Postado Fevereiro 2, 2006 Então, eu vi seu fla, e achei o seguinte erro, no movieclip "cxml" tem as ações no frame todas direcionadas pro _root, troque tudo o que você for ver de _root por _parent, use o find do painel de ações e vai dando find next por _root e tudo o que ele achar você troca por _parent, porque ai ele vai mandar pra timeline anterior, o que acontece é que quando você carrega por loadMovie ele vai procurar pelo _root do filme principal, e não vai achar as funções la pois elas estão na timeline do movieclip, depois tem uma função com _root tb na timeline principal, tire tb, sau action vai ficar assim: // Retrieves XML file and parses it into objects defined on // _parent.frame1 // Actually loading the file into two objects, the myXML object is used // primarily for internal debugging. It just spits out the contents of the // XML file using trace(); myXML=new XML(); radio_XML = new XML(); function getText(node) { text = ""; for (var i = 0; i < node.childNodes.length; i++) { if (node.childNodes[i].nodeType == 3) { text += node.childNodes[i].nodeValue; } } return text; } myXML.trace = function() { // this.indent = " |" +this.indent; if( this.nodeType==1 ) // element trace( this.indent +" [Element] "+ this.nodeName); if( this.nodeType==3 && !this.isBlank()) // text trace( this.indent +" text) "+ this.nodeValue); for(name in this.attributes) trace( this.indent +" +-attr-->"+ name+": "+this.attributes[name]); for( var i=0; i<this.childNodes.length; i++){ this.childNodes[i].isBlank = this.isBlank; this.childNodes[i].trace = this.trace; this.childNodes[i].indent = " |"+this.indent; this.childNodes[i].trace(); } } myXML.isBlank= function () { for( var i=0; i<this.nodeValue.length; i++) if( this.nodeValue.charCodeAt(i)>32 ) return false; return true; } myXML.onLoad = function ( ok ) { if( !ok ) trace ("load failure"); else{ trace( this.toString()); this.trace(); } } radio_XML.trace = function() { // Recurse through the tree for (var i = 0; i < this.childNodes.length; i++) { this.childNodes[i].trace = this.trace; this.childNodes[i].trace(); } // Now check for particular nodes and build data structure // First build songs array if (this.nodeName == "song") { trace ("**found song"); for (var i = 0; i < this.childNodes.length; i++) { if (this.childNodes[i].nodeType == 1) { switch (this.childNodes[i].nodeName) { case "title" : strTitle = getText(this.childNodes[i]); break; case "composer" : strComposer = getText(this.childNodes[i]); break; case "file" : strFile = getText(this.childNodes[i]); break; default : break; } // end switch } // end if } // end for // Now create song if (!_parent.newSongArray) _parent.newSongArray = new Array(); _parent.newSongArray.push(new _parent.Song(strTitle, strComposer, strFile)); trace ("**strTitle: " + strTitle + " * strComposer: " + strComposer + " * strFile: " + strFile); trace ("newSongArray.length: " + _parent.newSongArray.length); trace ("_parent.traceSong[" + (_parent.newSongArray.length - 1) + "]: "); _parent.traceSong(_parent.newSongArray[_parent.newSongArray.length - 1]); trace ("manual access strTitle: " + _parent.newSongArray[_parent.newSongArray.length - 1].title); trace (""); } // Now Build Station Array if (this.nodeName == "station") { for(name in this.attributes) { if (name == "name") { strName = this.attributes[name]; if (!_parent.newStationArray) _parent.newStationArray = new Array(); _parent.newStationArray.push(new _parent.Station(strName, _parent.newSongArray)); } } trace(""); trace("station[name]: " + strName); trace("call _parent.traceStation()"); _parent.traceStation(_parent.newStationArray[_parent.newStationArray.length - 1]); trace(""); delete(_parent.newSongArray); } if (this.nodeName == "radio") { _parent.objRadio =new _parent.Radio(_parent.newStationArray); } } function traceElements(node) { for (var i = 0; i < node.childNodes.length; i++) { if (node.childNodes[i].nodeType == 1) { trace("[el: " + node.childNodes[i].nodeName); var strVal = getText(node.childNodes[i]); trace(" val: " + strVal); } } } radio_XML.cleanse= function () { if( this.nodeType == 3){ for( var i=0; i<this.nodeValue.length; i++) if( this.nodeValue.charCodeAt(i)>32 ) return; this.removeNode(); } else { for( var i=this.childNodes.length; i--; ){ this.childNodes[i].cleanse = this.cleanse; this.childNodes[i].cleanse(); } } } radio_XML.isBlank= function () { for( var i=0; i<this.nodeValue.length; i++) if( this.nodeValue.charCodeAt(i)>32 ) return false; return true; } radio_XML.onLoad = function ( ok ) { if( !ok ) trace ("load failure"); else{ trace( this.toString()); this.cleanse(); this.trace(); trace("inline call of _parent.traceRadio();"); _parent.traceRadio(_parent.objRadio); _parent.nextFrame(); } } myXML.load(url); radio_XML.load(url); abraço, Carneirinho Compartilhar este post Link para o post Compartilhar em outros sites
RedLine 0 Denunciar post Postado Fevereiro 2, 2006 Valeu Carneiro. Te devo mais essa...minha conta tá ficando grande :blink: Compartilhar este post Link para o post Compartilhar em outros sites
RedLine 0 Denunciar post Postado Fevereiro 2, 2006 Update de problemas: depois de todas as alterações aí de cima, o flash funciona que é um mimo, desde que eu não tente passa-lo para o DW. Quando mando pro DW e consequentemente para o servidor, o radio simplesmente some. O menu tbm é um swf carregado externamente, mas aparece lá. O principal idem. Só meu radinho de pilha não.. Help de novo gente.... Compartilhar este post Link para o post Compartilhar em outros sites
carneirinho 7 Denunciar post Postado Fevereiro 2, 2006 Então, em nenhum html funciona ou só no servidor?Por acaso você não esta usando o html numa pasta e os swfs em outra tipo html na pasta www e os swfs na pasta swf, nã ota parecido com isso né? Compartilhar este post Link para o post Compartilhar em outros sites
RedLine 0 Denunciar post Postado Fevereiro 2, 2006 Por acaso tá :=STodos os html ficam em www....todos os swf na pasta flash. mas no DW está direcionado para carregar "flash/site.swf", por exemplo (esse é o principal. E o radio.swf na mesma pasta que o site. Passo o radio para www?Passei o radio para www, junto com o xml e as musicas. Voltei ao lance do undefined para os titulos....vou procurar uma ponte bem alta daqui a pouco.....cáspita Compartilhar este post Link para o post Compartilhar em outros sites
carneirinho 7 Denunciar post Postado Fevereiro 2, 2006 Então o erro é esse, na verdade nem é um erro, é só entender a forma de interpretação de hierarquia do html quando esta trabalhando no flash, pois ele vai pegar como base sempre o html, e não onde esta o flash, então se você ta com o html no www e os swfs no flash/ ele vai achar o primeiro swf, só que quando você for usar o loadMovie, ele vai procurar os swfs na pasta que estão o html, então ou você coloca tudo na pasta que esta o html, ou coloca o caminho no flash tipo flash/arquivo.swf isso ja deve resolver tudo. abraço Compartilhar este post Link para o post Compartilhar em outros sites