Sunday, March 28, 2010

AddEventListener Error 1119

I have created my custom component and my custom event, but when i add an addEventListener i get an 1119 error. Please help me!!!!!!!

CustomEvent

package classes.CustomEvents
{
?import classes.ValueObjects.Usuario;
?
?import flash.events.Event;

?public class AuthEvent extends Event?
?{
?public var authUser:Usuario;
?
?public function AuthEvent(type:String, authUser:Usuario)
?{
?super(type);
?this.authUser = authUser;
?}
?
?override public function clone():Event{
?return new AuthEvent(type, authUser);
?}?
?}?
}

Custom Component

%26lt;mx:Metadata%26gt;
?[Event(name=''authCustomEvent'', type=''classes.CustomEvents.AuthEvent'')]
%26lt;/mx:Metadata%26gt;

var authUserEvent:AuthEvent = new AuthEvent(''authCustomEvent'', usuario);

dispatchEvent(authUserEvent);

Main File


canvasLogin.addEventListener(AuthEvent.AUTH_CUSTOM_EVENT, authEventHandler); //Error

1119: Access of possibly undefined property AUTH_CUSTOM_EVENT through a reference with static type Class.

Can someone help me???????

AddEventListener Error 1119

Post the entire stacktrace.

Alex Harui

Flex SDK Developer

Adobe Systems Inc.

Blog: http://blogs.adobe.com/aharui

AddEventListener Error 1119

You create your event authUserEvent then you listen for the class authEvent.

if you are dispatching authUserEvent isn't that the event you would be listening for.

David

From the code you posted, you don't have a public static const variable for AUTH_CUSTOM_EVENT in your AuthEvent class.?That's why you're getting the error.

Thanks @yantzgh, Please can you help me with this???

http://forums.adobe.com/thread/492367

  • skin
  • No comments:

    Post a Comment