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

Error 1061

New Here ,
Sep 22, 2013 Sep 22, 2013

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.

TOPICS
ActionScript
911
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
Guru ,
Sep 23, 2013 Sep 23, 2013

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

should be simply

profile_btn.addEventListener(MouseEvent.CLICK,profileButtonClick)

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
New Here ,
Sep 23, 2013 Sep 23, 2013

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

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
LEGEND ,
Sep 23, 2013 Sep 23, 2013

Show the complete error message.

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
New Here ,
Sep 23, 2013 Sep 23, 2013
1061: Call to a possibly undefined method addEventListener through a reference with static type Class.
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
New Here ,
Sep 23, 2013 Sep 23, 2013
LATEST

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.

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