Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Listening to event within custom class

Participant ,
Mar 03, 2013 Mar 03, 2013

I've created a custom class that posts to a web page to authorize a user. How can I listen for an event within the custom class?

This is my code within my main class.

var customClass:CustomClass = new CustomClass();

var testingString = customClass.authorize("user@example.com", "password");

the fuction "authorize" within the customClass looks like this:

public function authorize(user:String, password:String):void

                    {

  jSession = new URLVariables();

                              j_Loader = new URLLoader();

                              jSession.j_username = user;

                              jSession.j_password = password;

                              jSend.method = URLRequestMethod.POST;

                              jSend.data = jSession

                              j_Loader.load(jSend)

}

How can I fire an event within my main class once the j_Loader triggers Event.COMPLETE?

TOPICS
ActionScript
312
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 03, 2013 Mar 03, 2013

You can fire an event using the dispatchEvent() function.

In your main class you assign a listener for the event the CustomClass dispatches after it exists.

Translate
LEGEND ,
Mar 03, 2013 Mar 03, 2013
LATEST

You can fire an event using the dispatchEvent() function.

In your main class you assign a listener for the event the CustomClass dispatches after it exists.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines