A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [Resolved] [Resolved] querying xml with actionscript

  1. #1
    Junior Member
    Join Date
    Jul 2001
    Posts
    2
    I modified the tutorial on importing xml into flash and finally got flash 5 to display my xml doc. Now, I'm trying to write a way to search the file, retrieving only search-relevant nodes and their children, but I can't find the best way. Please advise. So far, the only thing that works is pulling the nodeName from the xml doc, but I can only return that node's value to my dynamic text variable. I want that node and all its children returned to the variable.
    Thanks.

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    I this bit of code gets the node name that you want:

    myXML.firstChild.nodeName

    then

    trace (myXML.firstChild);

    Will output all of the nodevalue, and childnodes for that node.

    BTW which tutorial are you using?

    Thanks

    Luke



  3. #3
    Junior Member
    Join Date
    Jul 2001
    Posts
    2

    more query queries

    Thanks for your response. I have made some headway in querying since the post, thanks to you. The tutorial I was using was called FLash 5 and XML. I don't have a link for it. It was a basiscs on entering your xml data into flash.
    For my project, I need to build a searchable XML database with Flash as the front end, and no middleware. The dB is not that big so it doesn't put too much stress on Flash. The best query I have now looks something like:

    for (i=0;i<=elementList.length;i++) {
    if (recordElementName == "Name_I_Want" && recordElementValue == searchTerm) {
    result_display += recordElementValue.
    }else{
    result_display = "No Data Found."

    I'm basically learning XML and actionscript as I go. If there is a tutorial or an example somewhere showing how someone else already did this, that would be great. Thanks again for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center