Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-03-2012, 01:45 PM   #1
dogofsteel
Member
 
Join Date: Jan 2011
Posts: 65
Default import package form parent

Hi,

I have looked through all previous threads on this, but I can't seem to find a proper answer. I have a folder structure like this:

Projects
----classes
--------myclass.as
----Someproject
--------someproject.fla

the .as package is now:

ActionScript Code:
package Projects.classes

the import call is now:

ActionScript Code:
import Projects.classes.myclass

I get the error "Definition 'Projects.classes.myclass' could not be found"

I know that I could put the folder "classes" into the "Someproject" folder but I make a bunch of different small projects that all reference the same set of packages. So it would be very useful to be able to call them from the parent folder Projects.

any help would be AWESOME!

Last edited by dogofsteel; 06-03-2012 at 01:49 PM.
dogofsteel is offline   Reply With Quote
Old 06-03-2012, 02:13 PM   #2
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 9,840
Send a message via Skype™ to henke37
Default

The correct package here is the empty package. You shouldn't include irrelevant folders in the package path. Instead, set the class search path correctly.
__________________
Signature: I wrote a pair of articles about the timeline.
henke37 is offline   Reply With Quote
Old 06-03-2012, 02:17 PM   #3
dogofsteel
Member
 
Join Date: Jan 2011
Posts: 65
Default

Ok, well I can do empty package....but my question is really "what is the correct class search path".. I thought I had it correct with:

import Projects.classes.myclass
dogofsteel is offline   Reply With Quote
Old 06-03-2012, 04:56 PM   #4
henke37
Senior Member
 
henke37's Avatar
 
Join Date: Mar 2009
Location: Sweden
Posts: 9,840
Send a message via Skype™ to henke37
Default

That's not the class search path. The class search path is a compiler setting. It is a list of folders where the compiler will start looking for code. You can set it in the publish settings.
__________________
Signature: I wrote a pair of articles about the timeline.
henke37 is offline   Reply With Quote
Old 06-03-2012, 06:30 PM   #5
dogofsteel
Member
 
Join Date: Jan 2011
Posts: 65
Default

Thank you internet man!

Works great

Last edited by dogofsteel; 06-03-2012 at 06:31 PM. Reason: I'm not intelligent
dogofsteel is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:31 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.