This content has been marked as final. Show 8 replies
Describe how you are using your HTTPService. How are they sent, as in what triggers calling the send() method for them? Need more info on your situation.
I've defined and HTTPService as an MXML Component with an id of myService. I simple call a function that executes myService.send();
Here's a sample HTTPService that I'm calling:
Yes, but I'd like to know more about what calls the send() function of this HTTPService, the timing etc. What contains that component, how is send() called in your case, etc.
I'm not able to post my exact code due to restrictions but this is the exact process:
Calls a function to create a PopUp that controls the creation of variables and media ...
Varialbes are created are sent to a Bindable textfield @ parentApplication and a root Function is called.
Removes the previous PopUp, creates a new StatusPopUp and executes the request to my HTTPService. The service is set up per the above code.
The result removes the StatusPopUp, parses the xml response, and creates a final Alert.
That's the process...
So user clicks a button, fills in some information in a popup, closes the popup, and a new status popup appears, and the HTTPService is called? Can't imagine why it gets sent multiple times.
I still think it should be possible to boil this down to a greatly simplified sample app that still at least shows the structure of the app.
That's a barebones duplicate of what I'm doing in my other app... and this far I have not noticed it happen. This really sucks. There are differences between the two:
1) I'm using CF as my server-side script.
2) We're using sessions for user login and such.
I cannot duplicate the exact environment, but this will at least give you insight into how my App is structured.
I can't imagine how an HTTPService is being called twice, unless it's send it being called by some event that fires twice when you think it should be called once.
You might be able to have a Boolean variable okToSend set to true, and set it to false after the result handler finishes, that way it won't fire twice. But then you need a way for it to be set back to true when appropriate.
Well, I learned something new... after creating my own trace function and writing a log to the server, i found out that when you create a popup and initiate a Timer class, that Timer class is not remove along with the Popup. Thus the HTTPService was called once when i manually called it, and once more when the Timer officially ran out.
Word to Adobe: when a child is removed from the display list, so should everything within that child be also. Real nice.
Thank you for your help anyways, Greg. You led me to this conclusion.