Title: Scoping issue in event handler ?

    Hi,

    I am trying to set an external variable within an onLoad() event handler and later trying to access it as below .
    The variable in question here is newXML . After setting it within the eventHandler,  trying to access it outside the eventHandler thru the alert statement on the last line brings up an empty pop-up. My guess is that this is a scoping issue…however I do not seem to be able to set the variable newXML (and later retrieve its value) the way I am trying to.

    Would appreciate any help with this .  


    function search(){
            var newXML;
            var myXML = new XML();
            myXML.ignoreWhite = true;
            myXML.load("http://myserver.com/test.xml");

            myXML.
                    if(success){
                            newXML = "new value";

                    }else{
                           
                    }
            }
            alert(newXML);
    }

    Thanks
    -Daman



--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to