Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 765697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:55:41+00:00 2026-05-14T16:55:41+00:00

I am trying to learn Flex and now i have the next code: http://pastebin.com/rZwxF7w1

  • 0

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();
            }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T16:55:41+00:00Added an answer on May 14, 2026 at 4:55 pm

    It’s possible that tryLogin is called multiple times, meaning that you’d be adding multiple event handlers that does the same thing to the same event.

    You could try the following:

    protected function tryLogin():void {
                if (encryptStringResult.hasEventListener('result'))
                    return;
    
                encryptStringResult.addEventListener('result', function(event:ResultEvent):void {
                    encryptStringResult.removeEventListener('result', arguments.callee);
                    var encryptString:String = event.result.toString();
                    Alert.show('Done');
                });
                encryptStringResult.token = auth.getEncryptString();
            }
    

    It will first check wether or not there already is an event listener for ‘result’ in which case it will simply return. Also, it will remove the (anonymous) event listener that gets added when the event has been dispatched.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im just starting to learn flex and im trying to understand how Flex does
Trying to learn a bit of CSS and I want a horizontal navbar and
In trying to learn how to create objects in ActionScript, I have had no
I'm trying to learn C++ so forgive me if this question demonstrates a lack
I'm just starting to learn flex and AS3 I'm trying to get information into
I'm trying to learn Zend AMF but with Flash instead of Flex. I've seen
In the attached flex code, I am trying to call a javascript function in
I am tyring to learn flex programming myself. Below code gives me a warning
I was looking at some Cappuccino code (trying learn a little bit of it)
I am somewhat new to jQuery but have been having fun trying learn about

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.