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

  • SEARCH
  • Home
  • 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 565893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:55:12+00:00 2026-05-13T12:55:12+00:00

I am trying to create a class called LinkButton, which is a simple class

  • 0

I am trying to create a class called LinkButton, which is a simple class that loads a URL on a click (im doing this to simpify my designers’ transition to AS3). Even though I am importing the button definition, the AS file gets a compile error: 1046: Type was not found or was not a compile-time constant: Button. and 1172: Definition fl.controls:Button could not be found. I created the button by making a simple shape converting it to a symbol (F8) of type ‘Button’. In my FLA file i have this code:

import AS3classes.mouse.LinkButton;
var link1:LinkButton = new LinkButton(testLink, "http://www.example.com");

Simple right? In my AS file I am importing the button definition, declaring the constructor and ‘linkTo’ Behaviour. Here is my code in the AS file:

package AS3classes.mouse
{
 import fl.controls.Button;
 import flash.events.*;
    import flash.net.*;

 public class LinkButton 
 {
  private var _pageURL:String;
  private var _button:Button;

  public function LinkButton(button, pageURL) : void
  {
   _button = button;
   _pageURL = pageURL;
   _button.addEventListener(MouseEvent.MOUSE_UP, LinkTo);
  }

  private function LinkTo(e:Event) : void
  {
   var request:URLRequest = new URLRequest(_pageURL);
  }
 }
}

When I Google this, I see people getting this error because they don’t have a button in their library. I do have a button I created from a simple shape. Am I importing the right definition? I have no problem importing the movieClip definition in a different script with the same method. I don’t understand the difference, and I’m pretty sure I’m not stupid.

  • 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-13T12:55:12+00:00Added an answer on May 13, 2026 at 12:55 pm

    You are using the wrong type of button. As you describe it, you want

    flash.display.SimpleButton
    

    fl.controls.Button is a Button component, not a button defined in the library. Make sense? Try importing flash.display.SimpleButton and setting _button to be a SimpleButton instead.

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

Sidebar

Ask A Question

Stats

  • Questions 311k
  • Answers 311k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Don't convert your input string to ASCII if your input… May 13, 2026 at 10:22 pm
  • Editorial Team
    Editorial Team added an answer Hmm. Perhaps you’re right. In that case, simply use this… May 13, 2026 at 10:22 pm
  • Editorial Team
    Editorial Team added an answer I just added this post in my blog: EDIT: Moved… May 13, 2026 at 10:21 pm

Related Questions

I am trying to create a custom UIView that is stored in a nib
I am trying to create a simple mouseover effect using a combination of mouseover,
I'm having some trouble creating an object in C++. I create a class called
I have a bas class called Media with two classes that inherit from it,
I am trying to create a class that doesn't re-create an object with the

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.