RE: [Flashcoders] splitting classes into subdirectories?

2009-01-09 Thread Merrill, Jason
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


Re: [Flashcoders] splitting classes into subdirectories?

2008-12-17 Thread Taka Kojima
Hey Geoff,

Try this for your import instead...

   import cal.bentonconsulting.ca.model.mainModel;

should work like  charm.

- Taka

On Wed, Dec 17, 2008 at 4:48 PM, Benton Consulting <
ge...@bentonconsulting.ca> wrote:

> 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