Flex: Result event given multiple times
- by Tom
Hello everybody!!
I am trying to learn Flex and now i have the next code: http://pastebin.com/rZwxF7w1
This code is for my login component. I want to get a special string for encrypting my password. This string is given by my authservice. But when i login i get a multiple times a alert with Done(line 69 in the pastebin code or line 4 in the code on the bottom of this question). But i want that it shows one single time. Does someone know what is wrong with this code?
Tom
protected function tryLogin():void {
encryptStringResult.addEventListener('result', function(event:ResultEvent):void {
var encryptString:String = event.result.toString();
Alert.show('Done');
});
encryptStringResult.token = auth.getEncryptString();
}