Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Ricerca prodotto

This is a discussion on Ricerca prodotto within the Flash CS3 generale forums, part of the Flash CS3 e Actionscript 3.0 category; Ciao, stavo cercando un utility in flash per eseguire una ricerca in un file XML, l'xml è quello pubblicato assieme ...


Go Back   Forum Flash CS3 Flash CS4 > Flash CS3 e Actionscript 3.0 > Flash CS3 generale

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-05-08, 15:19
Junior Member
 
Join Date: Apr 2008
Posts: 26
Rep Power: 0
j0k3r is on a distinguished road
Ricerca prodotto

Ciao, stavo cercando un utility in flash per eseguire una ricerca in un file XML, l'xml è quello pubblicato assieme al Products Exhibitor.


Qualche idea?

Grazie...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 08-05-08, 10:28
Junior Member
 
Join Date: Apr 2008
Posts: 26
Rep Power: 0
j0k3r is on a distinguished road
Riferimento: Ricerca prodotto

Nessuno riesce a consigliarmi qualche utility?!?!?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #3 (permalink)  
Old 08-05-08, 14:56
Junior Member
 
Join Date: Apr 2008
Posts: 26
Rep Power: 0
j0k3r is on a distinguished road
Riferimento: Ricerca prodotto

Sono andato un po avanti, ora ho questo problema, non so come creare il codice per entrare dentro al nodo della categoria del prodotto...avevo pensato:
Code:
 stop ();
dati_xml = new XML();
dati_xml.ignoreWhite = true;
dati_xml.path = this;
dati_xml.onLoad = function(success)
{
    if(success){
        //result.text+="load data from prodotti.xml\n";
        var nodes = this.firstChild.childNodes;
        for(var i = 0; i < nodes.length; i++){
            var category = nodes[i].attributes.category name;
            var prodotto = nodes[i].attributes.name;
        
            if(codice.indexOf(_root.stringa)!=-1 || prodotto.indexOf(_root.stringa)!=-1){
                result.text+="category:"+category+"\nprodotto:"+prodotto+"\n";
            }
        }
}
else {
    result.text+="no data found\n";
}
};
dati_xml.load("prodotti.xml");
Se fossero stati allo stesso livello sarebbe dovuto funzionare...Il problema è che il nome del prodotto risulta come sotto-nodo della categoria, quindi non funziona!

Consigli????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #4 (permalink)  
Old 08-05-08, 15:03
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Ricerca prodotto

Ciao

vedere l' XML per favore
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #5 (permalink)  
Old 08-05-08, 15:09
Junior Member
 
Join Date: Apr 2008
Posts: 26
Rep Power: 0
j0k3r is on a distinguished road
Riferimento: Ricerca prodotto

Non capisco se è una domanda o una affermazione...comunque l'XML è il seguente:
Code:
<products>

    <category name="category 1">
        <product name="product 0" thumb="thumbs/thumb_0.jpg" image="images/pic_0.jpg" price="1.00 $" detailsURL="http://">
        <description>Lorem Ipsum 0 is simply</description>
        </product>
    </category>
</products>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Flash Multi Gallery
  #6 (permalink)  
Old 08-05-08, 15:18
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Ricerca prodotto

Se ho capito bene, stai cercando di recuperare il valore Lorem Ipsum 0 is simply.

Se sì, allora da dentro il ciclo lo becchi così:
Code:
var valoreNodo=nodes[i].firstChild.nodeValue;
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #7 (permalink)  
Old 08-05-08, 15:25
Junior Member
 
Join Date: Apr 2008
Posts: 26
Rep Power: 0
j0k3r is on a distinguished road
Riferimento: Ricerca prodotto

A dir la verità sto cercando di salvare solo i valori della categoria ("category 1") e del prodotto ("product 0"), non della descrizione...(e magari anche il numero totale di prodotti per ogni categoria ma non indispensabile)

Code:
var category
var product_name
Cosa dovrei inserire dentro al ciclo?

...grazie.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #8 (permalink)  
Old 08-05-08, 15:31
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,486
Rep Power: 6
Flep is on a distinguished road
Re: Ricerca prodotto

Dentro al ciclo:
Code:
var category:String = nodes[i].attributes["name"];
Per beccare il prodotto ti serve un altro ciclo innestato e come massima massima iterazione usi il valore di
Code:
nodes[i].childNodes.length
__________________

 


I recommend: Essential Actionscript 3.0

- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
- I do not reply technicians pvt messages. Open a thread !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #9 (permalink)  
Old 09-05-08, 09:36
Junior Member
 
Join Date: Apr 2008
Posts: 26
Rep Power: 0
j0k3r is on a distinguished road
Riferimento: Ricerca prodotto

Ho risolto cosi:

Code:
var nodes = this.firstChild.childNodes;
        for(var i = 0; i < nodes.length; i++){
            var category= nodes[i].attributes["name"];
            var prodotto = nodes[i].childNodes[0].attributes.name;
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Flash PHP Ricerca in piu' pagine jseeker Flash CS3 | PHP | mySQL 2 17-09-08 10:40
motori di ricerca damn73 Flash CS3 generale 0 02-04-08 14:27
motore di ricerca interessante mariano.martucci Off Topic - Libera la mente 2 25-08-07 20:47


All times are GMT. The time now is 15:06.


Powered by vBulletin versione 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap


FlepStudio
by Filippo Lughi
P.IVA 03605860406