Has anyone been successful in writing there own code with the connector
yet???  On other forums, have heard of a couple situations, and one I am up
against the wall with myself.  I have a page set up quite similar to the
employee directory example, the on(release) code set is almost identical,
the problem is that the flash function to be called once the dispatcher has
returned data, is run at the same time that the dispatcher send parameters
to the server.  Therefore, when the data is returned and the onSuccess call
is made, nothing happens.  Please, if anyone can offer any assistance, I
would greatly appreciative.  You can contact me either on or off list.  Code
example below!

Christian Watt
Webmaster
SkillPath Seminars
[EMAIL PROTECTED]

In the following example, the message never shows "Searching..." as soon as
the search button is pressed, you see "Got Data - Now populating".
You can connect to 63.117.129.245 to see the code work.

on (release) {
        // Create a server dispatcher
        if (typeof(serverDispatcher) == "undefined")
        {
                serverDispatcher = new
Object.F2S.Dispatcher("http://63.117.129.245/flashConnector/invoke.cfm";);
        }
        //resetSearch();
        message = "Searching...";
        
        // A. Define a result object with success and error callbacks
        function SearchResults(){
        }
        function SearchResult(){        
                message = "Got Data - Now populating";  
                this.onSuccess = function (result) 
                {
                        message = "Done Searching!";
                        //numSearchResults = resultSet.seminfoid.length;
                        // Loop thru results and show them in the
"searchResults" movie
                        //for (var i=0; i < numSearchResults; i++) {
                        //
_root.SemList.addSemTitle(resultSet.seminfoid[i], resultSet.Title[i], i);
                        //}
                        /* Dynamically determine the scrollrate of the
scrollWindow
                        based upon the number of results returned */
        
//this.resultViewer.calculateScrollRate(numSearchResults);
        
                        // Show the results
                        //_root.gotoAndPlay("showResults");
                }

                this.onError = function (msg){
                        // If an error occurs show it.
                        message = msg;
                }
        }


        // B. Construct a data packet
        var data = new Object();
        data.zipcode = zipcode;
        data.company = "SP";
        
        // C. Invoke the service. 
        serverDispatcher.call("SemListZip", data, new SearchResult());

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to