A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: SOLVED ::: writing XML from Flash to a file on the server using ASP

  1. #1
    Actionscript idiot Mattgyver's Avatar
    Join Date
    May 2001
    Location
    Charlotte, NC
    Posts
    119

    SOLVED ::: writing XML from Flash to a file on the server using ASP

    Anyone who has been trying to get ASP/VBscript to grab Flash data and write it to a file on the server (myself!), I've found the answer. I believe your server needs to be a Windows 2000 machine and be able to call the Microsoft XMLDOM Object. I'm just the designer - so I'm not exactly sure on other server specifics. Found the answer at http://www.4guysfromrolla.com/webtech/122800-1.2.shtml

    My site uses XML to write to the server http://www.mattgyver.com (the chalkboard uses XML)

    Flash Code

    // concatenate your xml into a string
    myXMLStr = myXMLStr + "<TAG>BLAH BLAH</TAG>";
    // the page to send the XML
    txtURL = "processing_page.asp";

    // create the XML object and content type, then send
    xmlChalkBoard = new XML(myXMLStr);
    xmlChalkBoard.contentType = "text/xml";
    xmlChalkBoard.send(txtURL, "_parent");

    And the VB script on the processing_page.asp

    'set variables
    Dim xmlFlashData
    Dim objPI
    Dim fileLocation

    Set xmlFlashData = Server.CreateObject("Microsoft.XMLDOM")
    'means the object will load all the data before proceeding
    xmlFlashData.async=False
    'THIS IS HOW IT GETS THE FLASH!!! WEEE!!!
    xmlFlashData.Load(Request)

    'Create the xml processing instruction (PI).
    Set objPI = xmlFlashData.createProcessingInstruction("xml", "version='1.0'")
    'Append the processing instruction to the XML document.
    xmlFlashData.insertBefore objPI, xmlFlashData.childNodes(0)
    Set objPI = nothing

    'get the root directory for saving the file
    fileLocation = Request.ServerVariables("APPL_PHYSICAL_PATH")
    'save the chalkboard data to the file
    xmlFlashData.save fileLocation & "chalkboard.xml"
    Set xmlFlashData = nothing


    And that about does it. Please send any questions from the contact page of my site (or write it on the board) - !

    - Mattgyver
    Last edited by Mattgyver; 06-26-2003 at 10:29 PM.

  2. #2
    Junior Member scudsucker's Avatar
    Join Date
    Feb 2003
    Location
    Cape Town, RSA
    Posts
    1,509
    Thank you sir!

    It took forever to find that vital line,
    'THIS IS HOW IT GETS THE FLASH!!! WEEE!!!
    xmlFlashData.Load(Request)
    That is the answer though- after trying all sorts of variations.
    Hariyemadzisawira nhaka yedu! Down the SCUD and win!
    I'm too lazy to read Private Messages.

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