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 8408739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:42:59+00:00 2026-06-09T23:42:59+00:00

So, I have a movieclip named LoginScreen with a instance inside called confirmbutton. I

  • 0

So, I have a movieclip named “LoginScreen” with a instance inside called “confirmbutton”.

I want to add the LoginScreen to stage and set a event listener to the button inside it, but I keep getting an error.

This is my code:

var LoginScreen:loginscreen = new loginscreen;
LoginScreen.x = stage.stageWidth / 2;
LoginScreen.y = stage.stageHeight / 2;
addChild(LoginScreen);

LoginScreen.confirmbutton.addEventListener(MouseEvent.CLICK, test);

function test(e:MouseEvent):void{
    trace("Sup?");
}

I get the error:

Symbol 'LoginScreen'    1046: Type was not found or was not a compile-time constant: confirmbutton.

I’m pretty sure it exists and its named properly (has that exact name without caps), so I’m guessing its probably a scope problem.

  • 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-06-09T23:43:00+00:00Added an answer on June 9, 2026 at 11:43 pm

    Try using a helper gettter function for getting the inner MovieClip. So where you defined the LoginScreen class put a simple getter function like this one:

    public function get ConfirmButton():MovieClip { return this.getChildByName("confirmButton") as MovieClip; }
    

    Then you can access that MovieClip from the LoginScreen object like this:

    LoginScreen.ConfirmButton.addEventListener(MouseEvent.CLICK, test);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a movieclip instance named 'placeholder' on the canvas, and I want to
i have a movieclip on my stage called dude inside the moviclip is a
I have a MovieClip instance which can be moved around the stage using startDrag()
On the stage I have a movieclip by the name of rect_mc . Inside
I have a square movieclip on stage. I am trying to set the dimensions
I have a movieclip called Tab that has two text-fields: named toptxt and bottomtxt.
I want to ask about this problem. I have a movieclip (instance name :
I have a MovieClip that I want the user to be able to drag
I have a movieclip. Its current y is 0, and I want to move
My stage have 3 movieclip that is mc1,mc2 and mc3. each of them are

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.