Sistema De Busca
flash com xml apresentando um link no resultado

- Usuário
-
-
Grupo:
Membros
-
Posts:
11
-
Cadastrado:
02-May 04
Postou 24 April 2008 - 09:32 PM
galera to precisando de um sistema de busca para flash utilizando um xml com banco de dados onde o resultado vai ser o titulo, autor, texto e link para os arquivo que estão na pasta arquivos, ja vi vários tuto na net mais nenhum dessa foma, ela só precisa ter a caixa de busca e os intem caso vc queira procurar por titulo, autor ou texto acrédito que seja simples mais como estou no inicio de flash isso ta sendo um terror
vou postar alguns link que eu vi em foruns e no google mais n me serve
http://imasters.uol....busca_em_array/http://imasters.uol....olecao_de_flas/http://www.google.co...a...busca&meta=vi todos esses do google e nenhum funcion da forma que eu quero se alguem poder me ajudar eu agradeço muito
0

- Usuário
-
-
Grupo:
Membros
-
Posts:
11
-
Cadastrado:
02-May 04
Postou 25 April 2008 - 08:15 AM
sera que ta tão difícil assim para ue ninguém saiba nem dizer um tuto para mim caramba.....
0

- Usuário
-
-
Grupo:
Membros
-
Posts:
11
-
Cadastrado:
02-May 04
Postou 25 April 2008 - 01:18 PM
Galera eu achei um muito bom mesmo
o AS dele é esse ta muio bom mesmo mais queria v se vc oderiam me ajudar no resultado de busca dele tipo ele seleciona e cria o link blz até ai tudo bem, teria c mudar tido na buca do xml tem Titulo, Autor e Texto teria como colocar cada um desses de uma cor no resultado da busca.
----------------------------------------segue ai o AS do flash bestof_search.fla
String.prototype.contains = function(searchString){
return (this.indexOf(searchString) != -1);
}
Array.prototype.contains = function(searchValue){
var i = this.length;
while(i--) if (this[i] == searchValue) return true;
return false;
}
SearchXML = function(nodes, query, useChildElements){
var results = [];
for (var i=0; i<nodes.length; i++){
for (var j=0; j<nodes[i].childNodes.length; j++){
currNode = nodes[i].childNodes[j];
if (useChildElements.contains(currNode.nodeName)){
if (currNode.firstChild.nodeValue.contains(query)){
results.push(nodes[i]);
break;
}
}
}
}
return results;
}
ElementsToSearch = function(){
var childElementsToSearch = [];
if (search_fields.title_check.checked){
childElementsToSearch.push("Titulo");
}
if (search_fields.author_check.checked){
childElementsToSearch.push("Autor");
}
if (search_fields.message_check.checked){
childElementsToSearch.push("Texto");
}
return childElementsToSearch;
}
DisplayNodes = function(nodes, field_txt){
field_txt.htmlText = "";
var entry;
var separator = "<br>_______________________<br><br>";
for (var i=0; i<nodes.length; i++){
entry = "";
entry += "<br>"+ nodes[i].childNodes[0].firstChild.nodeValue +"</br>";
entry += "<br>Escrito por: "+ nodes[i].childNodes[1].firstChild.nodeValue;
entry += "<br>"+ nodes[i].childNodes[2].firstChild.nodeValue;
if (nodes[i].attributes.url.length){
entry += "<a href='" + nodes[i].attributes.url;
entry += "'><font color='#0000FF'><br>Cluique aqui para conferir...</font></a>";
}
field_txt.htmlText += entry + separator;
}
}
search_highlight = new TextFormat();
search_highlight.color = 0xFF0000;
search_highlight.italic = true;
HighlightOccurences = function(str, field_txt, format){
if (!str.length) return (0);
var start = field_txt.text.indexOf(str);
var end = start + str.length;
while (start != -1){
field_txt.setTextFormat(start, end, search_highlight);
start = field_txt.text.indexOf(str, end);
end = start + str.length;
}
}
var posts_xml = new XML();
posts_xml.ignoreWhite = true;
posts_xml.onload = function(success){
if (success){
search_fields._visible = true;
}else results_txt.text = "Erro ao carregar XML ";
}
search_fields._visible = false;
posts_xml.load("bestofposts.xml");
search_fields.title_check.title_txt.text = "Titulo";
search_fields.author_check.title_txt.text = "Autor";
search_fields.message_check.title_txt.text = "Texto";
search_fields.search_btn.onRelease = function(){
if (search_fields.query_txt.text.length < 3){
results_txt.text = "Por favor, use um termo de pesquisa com 3 ou mais caracteres .";
return (0);
}
var searchElements = ElementsToSearch();
var nodesWithQuery = SearchXML(
posts_xml.firstChild.childNodes,
search_fields.query_txt.text,
searchElements
);
if (nodesWithQuery.length){
DisplayNodes(
nodesWithQuery,
results_txt
);
}else{
results_txt.text = "Não há resultados para "+search_fields.query_txt.text+".";
return (0);
}
HighlightOccurences(
search_fields.query_txt.text,
results_txt,
search_highlight
);
scrollbar.setScroll(0);
}
scrollbar.setTarget(results_txt);----------------------------------------e aqui vai o bestof_search.xml
<?xml version="1.0" ?>
<bestof url="http://www.kirupaforum.com/forums/forumdisplay.php?f=12">
<post url="http://www.kirupaforum.com/forums/showthread.php?t=43216">
<title>xml menu DONE
</title>
<author>hga77</author>
<message>
<![CDATA[Happy New Year kirupa....Hope all you ppl had a great year and didnt stick to flash too much
Anyways I just managed to finish the xml menu i've been working on...
I've attached it here incase any1 needs something like this. Use it as you like. Let me know if you make any additions to it
UPDATE(04/2004): you can find v2 for this menu on page 3 post #31
UPDATE(07/2004): you can find v3 for this menu on page 15 post #221]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=51430">
<title>Howd he do this? Resizing slideshow</title>
<author>niki</author>
<message>
<![CDATA[http://www.podlob.com/
click on #1. under "flash Research"
Ive tried searching these forums for resizing and slideshow but dont get what im looking for.
Im trying to learn how to build a thumbnail gallery that when you click on the thumbnail the photo will load in an empty movie clip and the emptymovieclip will resize itself to the size of the photo.
i guess i dont know what its called. but that link is pretty much what im looking for if I could turn those little numbers hes got there into thumbnails....]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=40686">
<title>Flash Drawing Board (MX)</title>
<author>jhaertel</author>
<message>
<![CDATA[Hi,
first of all: great Forum! great Site!
I came across the Flash MX Drawing Board Tutorial (http://www.kirupa.com/developer/actionscript/drawingboard.htm) and want to integrate it into a "Tactic Board" Application for a Team-Handball Website (I'll post links as soon i got further).
The Users could use the draw feature to create custom arrows etc.
Now my question:
Is there a practical way to "smoothen" the drawn lines? Like you can do inside Flash to get rid of those ugly "zig-zag" drawings.
I hope i made myself clear enough ... if not ask.
THANKS!]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=27214">
<title>Scroller by Claudio</title>
<author>blah-de-blah</author>
<message>
<![CDATA[I was wondering if it were possible to use hte scrollbar component to scroll images rather than text. But instead of 1 image, lots of small images which could be linked to other stuff when you press it. Is this possible with the scrollbar componenet?! thx]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=6924">
<title>Making The Flash Menu Go Awaaay!!!</title>
<author>pvoegele</author>
<message>
<![CDATA[I published a flash animation for my site. When I go to the page it loads correctly, but when I right click on the animation is displays a menu. How do I make that menu inactive? So that when it is clicked on, nothing comes up.
Is it something that I have to do when I publish???
I'm Clueless!!!!]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=7594">
<title>I Need Help On Action Scripting</title>
<author>twalliewerty</author>
<message>
<![CDATA[I AM DOING A SCHOOL PROJECT AND I CANT FIQURE OUT HOW TO MAKE MY SHIP THAT IM BUILDING MOVE THE RIGHT WAY. I HAVE IT SO WHEN I PRESS UP IT MOVES UP AND WHEN I PRESS LEFT AND RIGHT IT ROTATES IT LEFT AND RIGHT. IM TRYING TO FIGURE OUT HOW TO MAKE IT MOVE FORWARD IN THE DIRECTION THAT IT IS ROTATED IN. I BASICALLY CANT FIGURE OUT HOW TO MAKE IT MOVE ALONG A SLOPE... HELP ME OUT PLEASE...]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=6794">
<title>prototype preloader, use it</title>
<author>joyhost</author>
<message>
<![CDATA[How about a good prototype preloader?
U just type
[code]
It will show a loading bar and preload your movie into holder movieclip.
Just copy-paste this code to your first frame, first scene.
Then use in root or in an instance.
eg. mc1.loadhere(0,0,"pic1.jpg","pic1")
then the path of the loaded movie is _root.mc1.pic1
Maybe the code is a little bit dirty :x
If you have a question or suggestion.... post it!
[code]
Make sure you run it in server enviroment just to see preloader, or using xat.com WebSpeed simulator (not advertising it)]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=4009">
<title>relative mouse movement</title>
<author>Ibanez97</author>
<message>
<![CDATA[if (_root._xmouse>_level0.circle._x) {
_level0.circle._x = (_level0.circle._x+10);
} else {
_level0.circle._x = (_level0.circle._x-10);
}
this will make a movie follow the mouse ... how can I make the movie move
the same distance away from the mouse so that the two are lined up in the
middle but as I move the mouse to one side the movie travels and equal
distance to the other side. Any help anyone can give me would be great.]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=30908">
<title>Photo Gallery into slideshow?</title>
<author>brooklyniteOne</author>
<message>
<![CDATA[Using the tutorial found on this site here:
http://www.kirupa.co...hotogallery.htm
How can I set the gallery to continuously display random images? Like a looping slideshow effect.]]>
</message>
</post>
<post url="http://www.kirupaforum.com/forums/showthread.php?t=49179">
<title>calendar help</title>
<author>snaxs</author>
<message>
<![CDATA[Hello.. is it possible to make a date calendar in flashmx???
and highlight the date??? as every day passess?????
for example..
s m t w t f s
1 2 3 4 5 6
7 8 9 10 11 12 13
thanks.]]>
</message>
</post>
</bestof>
0

- Usuário
-
-
Grupo:
Membros
-
Posts:
11
-
Cadastrado:
02-May 04
Postou 27 April 2008 - 08:56 PM
Quando clico p ele fazer a busca ele me retorna o titulo, o autor e o texto e claro o link do arquivo para q eu possa clicar e abrir ok? Espero q até ai tudo bem... Só que todo o texto vem da mesma cor cinza claro menos o link entendeu? Queria q o titulo fosse exibido de outra cor tipo:
Título fosse de uma cor (sei la vermelho )
autor de outra e texto pode ficar do jeito q ta
o link também ta bom ele fica de azul bem destacado p vc ver q ele é um link entendeu?
Outra coisa q descobri ele n cadastra mais de 14 arquivos na busca hehehe... ai compliquei, mais tudo bem espero q vc possam me ajudar a resolver esse pro tb caso a gente consiga vai ser um ótimo material para turma que busca um sistema desse para busca interna em site flash usando um xml como banco
0

- Usuário
-
-
Grupo:
Membros
-
Posts:
1
-
Cadastrado:
07-April 09
Postou 08 April 2009 - 08:11 AM
Adriano, vc conseguiu encontrar uma solução para mais do que 14 caracteres?
0
1 usuário(s) está(ão) lendo este tópico
0 membro(s), 1 visitante(s) e 0 membros anônimo(s)