Should be the same.  Is MainModel in ca.bentonconsulting.ca or is it in the 
model package?  Seems you put it in the former.  

Also, classes need to be declared public:

package myPackage
{
        public class MainModel
        {
                public function MainModel()
                {
                }
        }
}


Jason Merrill
Bank of America     Instructional Technology & Media   ·   GCIB & Staff Support 
L&LD

Interested in Flash Platform technologies?  Join the Bank of America Flash 
Platform Developer Community 
Interested in innovative ideas in Learning?  Check out the Innovative Learning 
Blog and subscribe.





-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com 
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Benton 
Consulting
Sent: Wednesday, December 17, 2008 7:49 PM
To: flashcoders@chattyfig.figleaf.com
Subject: [Flashcoders] splitting classes into subdirectories?

Hi I'm moving from AS2 to AS3, very late to make the switch because  
I've been working on a large AS2 commercial framework incase you're  
wondering.

in AS2 I could do this:

- have a class called Main.as
- import model.MainModel

but in AS3 I can't, it won't find the file. For example

Main.as
package ca.bentonconsulting.ca{

        import model.mainModel; // compiler error

        class Main{
        }

}

MainModel.as
package ca.bentonconsulting.ca.model{

        class MainModel{
        }

}

So far the only way I can work around this problem is to put the model  
class right beside the Main.as class then say:

private var __model:MainModel; // works fine but doesn't allow to  
split classes into subdirectories

What am I doing wrong?

Geoff Freedman
Flash Developer
bentonconsulting.ca
1.403.680.3135

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to