:: 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 )