dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Returning values from OnXMLReply

  1. #1
    Junior Member
    Join Date
    Feb 2003
    Posts
    8

    Returning values from OnXMLReply

    Hello,

    Does anyone know if it is possible to return values from an OnXMLReply (after it has been parsed as I want it to be?? I can't seem to figure it out.

    I want to do something like

    sReturnValueFromXML = PostXML (); // this is ideally return sValue
    // from onPostReply

    function PostXML () {

    PostXMLReplyXML = new XML();
    PostXMLReplyXML.onLoad = onPostReply;
    PostXMLReplyXML.ignoreWhite = true;

    PostXML.sendAndLoad("http://home/xml.asp");


    }

    function onPostReply(bSuccess) {


    if (bSuccess == true) {

    Parse XML Reply and return it as value to waiting functing

    return sValue;

    }

    Thanks for any responses

    Stefan

  2. #2
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    Sorry but I don't know exactly what you mean when you say onXMLReply, but I am guess that you are wanting to return a value from the onLoad function?

    This is not possible as onLoad is a callback function, which means that flash will keep working while waiting for the xml document.

    I think your best bet will be to assign a variable a value that is changed when the document is loaded.

    Think about what will happen when a client loads your swf on a 14kbs modem line from outer mongolia and it takes 10 seconds to download the XML file?

    Thanks

    Luke
    Flash-XML FAQ
    http://www.tupps.com/flash/faq/

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