biggipsy Posted April 29, 2008 at 02:30 PM Report Share #182306 Posted April 29, 2008 at 02:30 PM Boa tarde Eu tenho o seguinte codigo if (items[i].attributes.type == "vazio") { // criar variáveis para os nossos elementos var species = items[i].firstChild; // same as items[i].childNodes[0] var textopequeno = items[i].childNodes[1];//second child node /* Criar um item de menu clip do filme, no menu_mc instância */ /*para cada item compensar cada elemento adicional na parte de baixo do ecran*/ var item_mc = menu_mc.attachMovie("menu_item","item"+item_count, item_count); item_mc._y = item_count * item_spacing; item_count++; // cede o texto usando nodeValue para ir buscar o texto // dos nos texto e secçoes CDATA item_mc.species_txt.text = species.firstChild.nodeValue; item_mc.main_btn.location_text = textopequeno.firstChild.nodeValue; // definir o onRelease do item botão para a função DisplayInfo item_mc.main_btn.onRelease = DisplayInfo; } } } e queria q ele em vez de estar a ler so um no que lesse dois, ou seja que lesse o Titulo e texto pequeno em vez de me estar so a permitir ler o Titulo o xml é o seguinte <?xml version="1.0" ?> <principal> <no> <item type="vazio"> <titulo>Março 2008 - Cantar com o Ruca </titulo> <textopequeno>teste texto pequeno 1 </textopequeno> <textogrande>Participe no passatempo e leve as crianças a assistir ao espectáculo "VEM CANTAR COM O RUCA - A FESTA SURPRESA"!<br/>Para participar, só tem de ligar o nº 760 78 78 18 (€0,60+IVA) e habilitar-se a ganhar um convite familiar para o VEM CANTAR COM O RUCA - A FESTA SURPRESA.Participe e habilite-se a ganhar convites para a festa surpresa do ano</textogrande> </item> <item type="vazio"> <titulo>Março 2008</titulo> <textopequeno>teste texto pequeno 2 </textopequeno> <textogrande>MaxMen oferece 10 bilhetes duplos para a ante-estreia do filme "Al Pacino 88 Minutos".Ante-estrei a 19 de Março em Lisboa no Cinema City Campo Pequeno e no Porto Uci Arrábida 29, às 21:30</textogrande> </item> <item type="vazio"> <titulo>Março 2008</titulo> <textopequeno>teste texto pequeno 3 </textopequeno> <textogrande>MaxMen oferece 10 bilhetes duplos para a ante-estreia do filme "Al Pacino 88 Minutos".Ante-estrei a 19 de Março em Lisboa no Cinema City Campo Pequeno e no Porto Uci Arrábida 29, às 21:30</textogrande> </item> <item type="vazio"> <titulo>Março 2008</titulo> <textopequeno>teste texto pequeno 4 </textopequeno> <textogrande>MaxMen oferece 10 bilhetes duplos para a ante-estreia do filme "Al Pacino 88 Minutos".Ante-estrei a 19 de Março em Lisboa no Cinema City Campo Pequeno e no Porto Uci Arrábida 29, às 21:30</textogrande> </item> </principal> Obrigada Link to comment Share on other sites More sharing options...
coxosclassic Posted April 29, 2008 at 03:27 PM Report Share #182333 Posted April 29, 2008 at 03:27 PM Oi, item_mc.main_btn.location_text.text = textopequeno.firstChild.nodeValue; nao faco a minima se será esse o teu problema pois nao experimentei o codigo... 👍 Se nao for avisa.. Cumps, cc Link to comment Share on other sites More sharing options...
biggipsy Posted April 29, 2008 at 03:39 PM Author Report Share #182338 Posted April 29, 2008 at 03:39 PM nao resultou; mas quase de certeza que o problema esta em item_mc.species_txt.text = species.firstChild.nodeValue; item_mc.main_btn.location_text = textopequeno.firstChild.nodeValue; item_mc.main_btn.location_text = textogrande.firstChild.nodeValue; tenho as variaveis declaradas var species = items[i].firstChild; // same as items[i].childNodes[0] var textopequeno= items[i].childNodes[1];//second child node var textogrande = items[i].childNodes[2]; Link to comment Share on other sites More sharing options...
biggipsy Posted April 30, 2008 at 09:51 AM Author Report Share #182576 Posted April 30, 2008 at 09:51 AM boas encontrei a solução de poder visualizar o titulo juntamente com o texto pequeno item_mc.species_txt.text =species.firstChild.nodeValue+" - "+textopequeno.firstChild.nodeValue; agora tou a inserir mudanças de linha Link to comment Share on other sites More sharing options...
biggipsy Posted April 30, 2008 at 09:54 AM Author Report Share #182578 Posted April 30, 2008 at 09:54 AM ja agora se alguem me puder ajudar tendo item_mc.species_txt.text =species.firstChild.nodeValue+" - "+textopequeno.firstChild.nodeValue; o flash vai me ler o "species" e "textopequeno" m eu queria provocar uma mudanças de linha e nao tenho conseguido, alguem me pode ajudar? obrigado Link to comment Share on other sites More sharing options...
biggipsy Posted April 30, 2008 at 11:31 AM Author Report Share #182605 Posted April 30, 2008 at 11:31 AM esqueçam ja resolvi , bastou colocar o codigo item_mc.species_txt.text=species.firstChild.nodeValue+"\n"+textopequeno.firstChild.nodeValue; e tinha uma variavel var item_spacing = 20; bastou colocar var item_spacing=40; ficando assim resolvido obrigado Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now