Skip to main content
Participant
September 23, 2013
Question

Error 1061

  • September 23, 2013
  • 2 replies
  • 958 views

Here is my code, I keep recieving error 1061.



public var userID:String;


public var myUserID:String;


public var myUsername:String;

profile_btn.addEventListener(MouseEvent.CLICK, this.profileButtonClick);


private function profileButtonClick(_arg1:MouseEvent):void{

var _local2:URLRequest = new URLRequest(("http://www.domain.com/userprofile.php?user=" + myUsername));

navigateToURL(_local2, "_blank");

}

The point of this is to click on either a button or link to go directly to user's profile.

This topic has been closed for replies.

2 replies

Ned Murphy
Legend
September 23, 2013

Show the complete error message.

Participant
September 24, 2013
1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
Participant
September 24, 2013

I have it done right, had to go to one of my mc's and add

profile_btn.addEventListener(MouseEvent.CLICK, profileButtonClick);  As an action.

Then I had to go to my .as and add

       

private function profileButtonClick(_arg1:MouseEvent):void{
        var _local2:URLRequest = new URLRequest(("http://www.user/" + userToInvite));
        navigateToURL(_local2, "_blank");
        }

userToInvite meaning, user's screen name.  It works well now.

Inspiring
September 23, 2013

profile_btn.addEventListener(MouseEvent.CLICK, this.profileButtonClick);

should be simply

profile_btn.addEventListener(MouseEvent.CLICK,profileButtonClick)

Participant
September 23, 2013

You're right, however this is for .as class. Even removing (this) still has the same result.