A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: flash and xml help...

  1. #1
    Junior Member
    Join Date
    Dec 2004
    Location
    Georgia
    Posts
    6

    flash and xml help...

    I have a calender (.fla) that used to work with an xml file.
    I changed the the information in the xml doc and now the new information won't pull up! Can someone help me? Does something in the FLA need to be updated as well?


    A few more details that may or may not help... the swf used to highlight the dates on the calender that were inserted as
    (diary)(cal)(date ID="XX")(msg)blah blah(/msg>)(date)(/cal)(/diary)
    I changed nothing EXCEPT the actual DateID and message.
    Now, uploaded into the same directory using dreamweaver, it doesn't work. SWF shows up but no dates are highlighted for viewing.
    Thanks SOMEONE! ANYONE!
    Last edited by sloppyjo; 12-07-2004 at 03:50 PM.

  2. #2
    pablo cruisin' hanratty21's Avatar
    Join Date
    Mar 2002
    Location
    on the lam
    Posts
    2,275
    Test it in flash using the Test Movie function and add a trace command:
    code:

    trace(yourXMLfile.xml);


    to see if the XML is actually loading. One of two things is probably happening...
    either
    a - XML is not loading
    -or-
    b - XML parsing needs to be modified based upon your new schema.

    RH
    "Why does it hurt when I pee?" -- F. Zappa |

  3. #3
    Junior Member
    Join Date
    Dec 2004
    Location
    Georgia
    Posts
    6
    I added a trace in a layer underneath the xml actions layer.

    When testing, the output lists cal.xml, which means it's loading? right? But it isn't inputting the data.

    Forgive my lack of knowledge but what is meant by
    "XML parsing needs to be modified"

  4. #4
    Junior Member
    Join Date
    Dec 2004
    Location
    Georgia
    Posts
    6
    BTW: here's the hml actions

    XMLData = new XML();
    XMLData.load("cal.xml");
    XMLData.onload = viewApp;
    function viewApp() {
    mainTag = new XML();
    arrCal = new Array();
    arrDate = new Array();
    arrMsg = new Array();
    mainTag = this.firstChild.nextSibling;
    if (mainTag.nodeName.toLowerCase() == "diary") {
    arrCal = mainTag.childNodes;
    for (i=0; i<=arrCal.length; i++) {
    if (arrCal[i].nodeName == "cal") {
    if ((arrCal[i].attributes.yearID == myNewYear) and (arrCal[i].attributes.monthID == myNewMonth)) {
    arrDate = arrCal[i].childNodes;
    for (j=0; j<=arrDate.length; j++) {
    if (arrDate[j].nodeName == "date") {
    diaryDate = arrDate[j].attributes.id;
    myDiary = _root["Numbers"+diaryDate];
    myDiary.gotoAndStop(3);
    arrMsg = arrDate[j].childNodes;
    for (k=0; k<=arrMsg.length; k++) {
    if (arrMsg[k].nodeName == "msg") {
    }
    }
    }
    }
    }
    }
    }
    }
    }

  5. #5
    pablo cruisin' hanratty21's Avatar
    Join Date
    Mar 2002
    Location
    on the lam
    Posts
    2,275
    Are you sure the xml is properly formatted? An easy check for that would be to open the XML file with Internet Explorer. If it is properly formatted, then it should display in tree format. If not, check to make sure all tags are closed properly.

    As far as what the XML parsing means, the AS you posted is the XML parsing function. Basically it's the process that yur flash AS is using to pull the necessary data out of the properly formatted XML doc.

    Another problem could be a weird character in the xml (&,% type of thing). If you still have no luck, I would suggest reposting this in the XML forum. You'll have much better luck finding a quick answer there. I would suggest posting the AS along with the XML file itself.

    RH
    "Why does it hurt when I pee?" -- F. Zappa |

  6. #6
    Junior Member
    Join Date
    Dec 2004
    Location
    Georgia
    Posts
    6
    THANK YOU!!!!!!!!!!!!

    I was SO convinced the XML file was correct, I just KNEW it was an error in my flash.

    I was wrong! Thanks for helping me, you helped me realize there was a (br) tag that once I deleted things worked great.

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