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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:56:35+00:00 2026-05-13T15:56:35+00:00

:: EDIT :: This question is a little sprawling, so I’m trimming it down

  • 0

:: EDIT ::

This question is a little sprawling, so I’m trimming it down to make it more concise.

SUMMARY:

When I have a class linked to a MovieClip in my library and that class takes an argument in its constructor method. That class will compile properly ONLY when it’s located in my top-level directory (same dir as the .fla and Document.as files). If I move that class to a deeper directory, say com.place, and update the package statement and symbol link appropriately, the compiler will generate error “1136: Incorrect number of arguments. Expected 0.”

TO RECREATE:

  • Create flash project and put a rectangle on the stage. Covert it to symbol and assign it to class TestPanel – or whatever you choose. Also configure the fla so that is uses a Document (Main) class.

  • Create Main.as and TestPanel.as in the same folder. In the Main class, instantiate a instance of TestPanel and add it to the stage. Flash will, predictably, add the rectangle symbol and everything is fine.

  • Now modify TestPanel so that its constructor method takes a Number and have Main.as pass some number to TestPanel.

    public function TestPanel( num:Number )
    {
    trace( ‘TestPanel is created: num = ‘ + num );
    }

    public function Main()
    {
    trace( ‘Main is initialized’ );
    var myTestPanel:TestPanel = new TestPanel( 5 );
    addChild( myTestPanel );
    }

  • Now move TestPanel to com/place/TestPanel and update the package statement to reflect its new location. Also update the rectangle symbol in the library so that it links to com.place.TestPanel.

You now get the error: 1136: Incorrect number of arguments. Expected 0.

When I move the TestPanel.as into a deeper directory, Flash somehow is looking elsewhere for the base class for Symbol, even though I’m mapping that Symbol to com.place.TestPanel.

Can anybody recreate this and tell me where I’m tripping up?

( sorry for not highlighting the code in this post. I can’t seem to get this editor to work properly )

  • 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-13T15:56:36+00:00Added an answer on May 13, 2026 at 3:56 pm

    I realized where I’m getting my error.

    First, thanks for everybody’s input.

    What happened was that my Symbol was linking to my class in the ‘Base class’ field as opposed to the ‘Class’ field. I don’t know exactly when I started this habit but I’ve been doing it forever and apparently it didn’t matter because none of my classes used arguments in their constructor- until now. This also explains why it works in the top-level directory and not when nested in com/place/whatever.

    For anybody who stumbles upon this same/similar problem, remember to check to see that you symbol links to your class in the ‘Class’ field, not the ‘Base Class’ field.

    Here’s a link a Adobe’s documentation on the subject.

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

Sidebar

Related Questions

I need to solve the following question which i can't get to work by
I want to get the header of a selected tab-item of a tab-control and

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.